[Qt-interest] set connection timeout on QTcpSocket/AbstractSocket

Donal O'Connor donaloconnor at gmail.com
Thu Jul 30 16:09:13 CEST 2009


I'm  not sure but I doubt it since I'm using IP's

It gets even stranger, my events and debug messages all come out opposite to
when called.

I've a button to start attempt connection. This then changes the text on
button to "cancel".
however, this change does not happen unless I force to process events before
calling connect like:

QApplication::processEvents();

if (m_tcpSocket->state() == QAbstractSocket::UnconnectedState)

    m_tcpSocket->connectToHost(QHostAddress(m_serverAddress), m_port);


I can't explain it but the things I've called before the connectToHost get
called after the sequence of events/signals I call after the timeout - that
probably makes no sense!


Anyways, the whole thing is acting like a synchronous connect - I've tried
the none blocking fortune client example.
Entered a dummy IP on the same subnet my wifi card configured for with a
dummy port number.

As soon as I click get fortune, the whole client freezes, I can't even move
the application around. As matter of fact,
the whole windows mobile starts getting a little strange. Then 30 seconds
later, the timeout error messagebox comes through and back to normal.


Do you think this could be a bug. I'm using Windows Mobile 6.1 (HTC Touch
Diamond 2) and QT version 4.5.2


Thanks.
Donal

On Thu, Jul 30, 2009 at 3:04 PM, Stephen Collyer
<scollyer at netspinner.co.uk>wrote:

> 2009/7/30 Donal O'Connor <donaloconnor at gmail.com>
>
>> Hi,
>>
>> Sounded like a good idea but...
>>
>> I set it a single shot of 1000ms before I attempted to call connect.
>> Whole program locks up then for 30 seconds and I get to timeout slot
>> called then after 30 seconds rather than 1.
>>
>> Everything is fine once I can contact the server, but when it not
>> contactable, this is what happens.
>>
>>
> This sounds pretty odd. Is it some kind of nameservice look-up being
> done synchronously in the current thread ?
>
> --
> Stephen Collyer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090730/32bf4b10/attachment.html 


More information about the Qt-interest-old mailing list