Hello,
A few years ago, I developed a free server monitor (bMonitor) that has
ping, port, and http(s) monitor capabilities. It has required very
little maintenance to keep up with the rapidly evolving Android OS.
However, in the last several months I have noticed more and more users
are complaining that ping does not work for them. I think I have
finally tracked this down to the isReachable method of the InetAddress
class. It literally seems to work sometime and not others.
More research on the isReachable method revealed that it first tries
to use the ICMP ECHO request, and if that fails tries the much slower
TCP version of ECHO.
More recently, I have found that the only way I can get isReachable to
work is using the loopback address as the host. Every time I try to
ping an external host, it fails. I have even tried putting a very long
time out (greater than 1 min) as the input parameter.
_blnStatus = InetAddress.getByName("localhost").isReachable(20000);
The above line of code has worked for as long as I can remember. It
now seems, it fails more often than not.
I have also read that ping requires root access. However, I have a
terminal emulator installed on my phone that is NOT rooted, and ping
does work from it.
So, I guess I have several questions.
1) Has anybody else been experiencing the same problem?
2) Has something changed in the API to cause this?
3) Is it possible to run ping from my application, or do I need to
implement a custom ping routine?
Thank you in advance for any help on this perplexing problem.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en