PDA

View Full Version : How to monitor the Pc internnet connection contineously



addu
29th October 2009, 05:03
Hi All


I am using pjsip with Qt .

When network connection is failed my application is going to crash , it is problem of pjsip side.

So i want to monitor my pc network connections contineously

Which class i have to use to see the internet connection status .

please help me


Thanks

Yuvaraj R

aamer4yu
29th October 2009, 05:36
You can use a timer with some web query.... you can know the net got disconnected if u dont get the reply.
Am not sure if this is the correct way though.

addu
29th October 2009, 05:57
i think , your way is incorrect.

any other ways ?


Thanks

Yuvaraj R

squidge
29th October 2009, 08:00
You want a portable way? Use QSocketDevice and attempt to connect to some host outside your network.

If you want better than that, then you'll have to go down the non-portable route and use Winsock (Windows) or Berkeley sockets (Linux) and use UDP or ICMP packets. For the later you may need to be SUID root on Linux.

Or maybe you can spawn a process and run the command "Ping" and monitor the output.