I am stumped. InetAdress.isReachable simply does not work. By that I
mean, it always returns false for an external host.

I have tried searching the internet to see if anybody else is having
the same problem, I have found a few people have had the same problem,
but cannot really find an explanation why.

I have tried this on multiple devices with the same result.

boolean blnResult =
InetAddress.getByName("localhost").isReachable(20000);

The above line of code works every time. If I change the "localhost"
to an external host that I can verify "isReachable", the result is
always false.

blnResult =
InetAddress.getByName("www.google.com").isReachable(20000);
blnResult = InetAddress.getByName("4.2.2.2").isReachable(20000);

The above lines always return false, even though I can use a terminal
emulator on the same device and get a true result.

Can somebody more experienced with Android or perhaps a Google
engineer please give a plausible explanation for this.

-- 
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

Reply via email to