Tim McGuire wrote:
mahdi farzami wrote:
If you just want to know if the pc is connected to internet or not, ping www.google.com or some other very common host, like some DNS server, and check if the ping is replying or not.
how can i do this in my app ???
by doing a google search on "java ping"
Forgive me. I responded too hastily. For several reasons, the information from a google search on this subject is confusing.
What I found out after following my own advice is that isReachable() is not a fail-proof way to ping something.
This bit of code worked for me: