SetPayload() public method

Sets the payload of this packet.
public SetPayload ( byte payload ) : void
payload byte The payload.
return void
Ejemplo n.º 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);
        }
Ejemplo n.º 2
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;
        }