Hi,

supposably I'm facing a minor problem by reading from an underlying socket via QDataStream.
Writing through the data stream runs quite well, like seen here:

Qt Code:
  1. QByteArray block;
  2. QDataStream out( &block, QIODevice::WriteOnly );
  3. out.setDevice( m_TcpSocket );
  4. out.setVersion( QDataStream::Qt_5_0 );
  5. out << "HELLO CLIENT!\x0d\x0a";
To copy to clipboard, switch view to plain text mode 

But reading fails in getting a ReadPastEnd - status, when reading takes effect by using QDataStream.

Qt Code:
  1. QByteArray block;
  2. QDataStream in( m_TcpSocket );
  3. in.setVersion( QDataStream::Qt_5_0 );
  4. in >> block;
To copy to clipboard, switch view to plain text mode 

Other way round, using only
Qt Code:
  1. QByteArray data = m_TcpSocket->readAll();
To copy to clipboard, switch view to plain text mode 
reads everything needed.

I was also working through the Fortune example. But here the server/client will always close the connection, which in my case is not reasonable.
Any guesses? Many thanks in advance.

Br,
Oliver