I use Clojure, but I can read Java, so this question is not Clojure. It doesn't even feel like working with Java.
I am trying to implement a bit of the "ping" function using isReachable. The code I use is as follows:
(.isReachable (java.net.InetAddress/getByName "www.microsoft.com") 5000)
Java translation by my good friend:
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 them return false. I believe that I should do it wrong, but Google research tells me differently. I'm confused!
Rayne source
share