/// <summary> /// Client only! /// </summary> /// <returns></returns> public byte[] Receive() { if (Type == StreamType.ClientUnidirectional) { throw new StreamException("Cannot receive data on unidirectional stream."); } while (!IsStreamFull() || State == StreamState.Recv) { _connection.ReceivePacket(); } return(Data); }