I'd suggest you to use.Qt Code:
socket->connectToHost("hostName", portNumber); if (socket->waitForConnected(1000)) qDebug("Connected!");To copy to clipboard, switch view to plain text mode
In this method, you can try connecting to a valid host to a period of time and if it succeeds then fine otherwise time out will occur. The value of trying time is in your hands.
Bookmarks