Qt: default connection timeout for QTcpSocket

Please advise how to set the default connection timeout without using the waitForConnected () blocking method? I noticed that the socket emits an error signal (QAbstractSocket :: SocketTimeoutError) after about 60 seconds, which I can handle as a timeout, but can this timeout be adjusted?

+3


source to share


1 answer


You can use QTimer

:



When developing, be sure to plug in stateChanged(...)

and error(...)

signal at least debug slots that just print arguments. This way, you will see when something happens in a way that you did not expect.

+6


source







All Articles