PDA

View Full Version : waitForConnected does not block



kovica
13th May 2010, 10:11
First of all let me say that I'm more fluent in Java and I've been using Qt only for a week now. :)

I'm creating a server/client application. Server is in Qt and seems to be ok, since I have a client in Java that works ok.
Now I'm doing a Qt client and that client is getting QAbstractSocket::SocketTimeoutError when I call socket.waitForConnected(25000). The error does not occour after 25 seconds as defined by the method parameter. Why? What can I do to prevent this socket timeout errors?

I've searched trough posts and did not come up with anything usefull.

Thanks.

kovica
13th May 2010, 10:51
I have to say that I'm using Qt 4.6.2 on Windows XP with SP3.

I've tried some other things too and if I put a small sleep (for 50 msecs for example) in my code, everything is OK. But puttings sleep aroung my code is not what I want.
I also found out that I start getting those timeout errors when "netstat -an" has about 4500 opened connection.