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

Alex shao.tu at gmail.com
Thu Jul 30 13:43:22 CEST 2009


Use waitForConnected(timeout) after connectToHost().
It returns once the connection is established or timeout occurs.




2009/7/30 Donal O'Connor <donaloconnor at gmail.com>

> Hi,
>
> I've searched the docs everywhere but I cannot see if it is possible to set
> a timeout value when connecting to a host.
>
> I'm using connectToHost(server,port). This seems to hang my application on
> Windows CE until it times out about 10 - 30 seconds later when I receive the
> error via the
> error() signal emitted.
>
> Is there a way to set a timeout value so I don't have to wait this long
> before showing the error to the user?
>
>
> Thanks,
>
> Regards,
> Donal
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090730/09b36bd5/attachment.html 


More information about the Qt-interest-old mailing list