PDA

View Full Version : Checking internet connection..



Gokulnathvc
24th February 2012, 07:54
How to check whether the internet connection is available in the machine or not using Qt codes???

I would like to know if the internet connection persists or not, need to ping to simple page via Google.com or yahoo. com

Blackened Justice
24th February 2012, 10:07
In a "kludge" way, you could do just that, adding a system("ping google.com") and then parsing the output. There's probably a simpler, "Qter" solution though ;)

stampede
24th February 2012, 11:01
Check this method: QNetworkAccessManager::networkAccessible() (http://developer.qt.nokia.com/doc/qt-4.8/qnetworkaccessmanager.html#networkAccessible-prop)

Le_B
24th February 2012, 11:11
i think this method told you that the network is up not that the internet connection is.