SteamKit2.TcpPacket.SetPayload C# (CSharp) Method

SetPayload() public method

Sets the payload of this packet.
public SetPayload ( byte payload ) : void
payload byte The payload.
return void
        public void SetPayload( byte[] payload )
        {
            this.Clear();
            this.Write( payload );
        }

Usage Example

Example #1
0
        /// <summary>
        /// Attempts to receive a tcp packet from the socket.
        /// </summary>
        /// <returns>The packet.</returns>
        public TcpPacket ReceivePacket()
        {
            TcpPacket pack = new TcpPacket();

            uint size = NetHelpers.EndianSwap(this.Reader.ReadUInt32());

            byte[] payload = Reader.ReadBytes(( int )size);

            pack.SetPayload(payload);

            return(pack);
        }
All Usage Examples Of SteamKit2.TcpPacket::SetPayload