Results 1 to 2 of 2
Thread: Detecting Internet Disconnection
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Feb 2008
Detecting Internet Disconnection
I am writing a chatting program and want to receive the notification on Internet disconnection (e.g. when the cable is unplugged). Is there any way to achieve this? Thanks in advance!
Wouldn't it be enough to determine:
"Packets not sent => no connection"
The concrete implementation depends on the kind of communication you have. If it is centralized you can either have "server down" or "internet disconnect", if it is decentralized it's either "peer down" or "internet disconnect", where "internet disconnect" is somewhat alike "all peer down".
Another, and probably the "cheapest" implementation would be a ICMP ping to a server that is always up (i.e. 8.8.8.. But it is also the implementation that is the least related to your software. If 22.214.171.124 is down it doesn't necessarily mean your software can't work anymore.