isReachable in Java doesn't appear to be working quite the way it's supposed to
Posted
by Rayne
on Stack Overflow
See other posts from Stack Overflow
or by Rayne
Published on 2010-05-05T22:31:16Z
Indexed on
2010/05/05
22:38 UTC
Read the original article
Hit count: 208
I'm using Clojure, but I can read Java, so this isn't a Clojure specific question. This doesn't even seem to be working from Java.
I'm trying to implement a bit of a 'ping' function using isReachable. The code I'm using is this:
(.isReachable (java.net.InetAddress/getByName "www.microsoft.com") 5000)
Translated to Java by a good friend of mine:
public class NetTest {
public static void main (String[] args) throws Exception{
String host = "acidrayne.net";
InetAddress a = InetAddress.getByName(host);
System.out.println(a.isReachable(10000));
}
}
Both of these return false. I suppose I must be doin' it wrong, but Google research is telling me differently. I'm confuzzled!
© Stack Overflow or respective owner