|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
InetAddress isReachable fails with jdk7u but passes with jdk8u.
Sample Program:
import java.net.InetAddress;
public class Test {
public static void main(String[] args) {
try {
final InetAddress addr = InetAddress.getByName("hostname");
final boolean isReachable = addr.isReachable(2000);
if (!isReachable) {
System.out.println("Not Reachable");
} else {
System.out.println("Reachable");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Excepted: Reachable
Actual: Not Reachable
|