1. Seeking in a socket device doesn't make sense as it is not a random access device.
2. If you use QDataStream, you don't need to send the size of QByteArray as QDataStream will do that for you. Remember that this is a serialization mechanism, not a simple binary stream.
3. connectToHost() is an asynchronous call - you have to wait for the connection to be established before sending/receiving any data. The same goes for disconnectFromHost (I think you meant that and not disconnect(), right?).
Bookmarks