Hi all,

I'm having some trouble to read from a QTcpSocket returned by QTcpServer. The situation is like this:

1) Server listens
2) Clients connects and sends a message to identify itself
3) Server creates a Client object using the data in this message

The problem is #3, a QTcpSocket is returned when calling nextPendingConnection() and the message from the client has been sent correctly. Though the bytesAvailable() function on the returned QTcpSocket keeps returning 0. With as a result that I can't read the message obviously and thus can't create the client object.

The weird thing is, that when I immediately create a thread to handle the newly returned QTcpSocket I can read from the socket just fine. But since the client object is a thread itself it seems pretty bad to create another thread just to handle the message so I can extract the data.

Is there anyone who has encountered this before and possibly knows a workaround? I'm willing to post a testcase which probably will illustrate the problem better.