Results 1 to 2 of 2
Hello,
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-21-2011 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 21
Detecting Internet Disconnection
Hello,
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!
- 03-22-2011 #2
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 8.8.8.8 is down it doesn't necessarily mean your software can't work anymore.


Reply With Quote
