PDA

View Full Version : QTcpSocket connectToHost() Windows problem



Krzysztow
7th November 2011, 11:20
Hello all,

recently I switched from Qt 4.6.2(32bit) to Qt 4.7.4(32bit), on Windows, and came accross a strange problem. Namely, when using QTcpSocket::connectToHost() with port 8888 I always get immediate connection, even though there could be no device with a specified ip address. By 'immediate connection', I mean that waitForConnected() returns true immediately, the connected() signal is emitted and socket state changes to Connected. On the previous Qt version this was not an issue. It neither happens on Linux machines.
The issue also occures when executing Qt Fortune Client example - if someone wants to reproduce this, fill wathever IP you want and set port to 8888. No other port (at least those that I have tried) seems to behave like this. The simplest solution would be to change port to some other number, however I can't do it at server devices.

Please, if You have any idea for solution to this problem, share them on this forum with me and other users.

Thanks in advance,
Krzysztof.