/// <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); }
/// <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; }