Hello, that's the code:
I chose gamato.info as it is an unresponsive server and I noticed that the whole application hangs for 15 seconds.Qt Code:
QTcpSocket sock; sock.connectToHost("www.gamato.info", 80); if (sock.waitForConnected(15000)) qDebug("Connected!"); else qDebug("Not connected!");To copy to clipboard, switch view to plain text mode
The function in which this runs is static and cannot be run through QtConcurrentRun!
The actual problem is checking if internet connection is established or not, but this way I take the non-rare situation in which internet connection may be established locally but modem not connected etc.
I need a way
Bookmarks