Hi all,
I tried to execute the following code
try{
NetworkInterface ni = NetworkInterface.getByName("eth0");
System.out.println("\nGetting Host Name ....");
InetAddress[] addr = InetAddress.getAllByName("192.168.6.252");
for(int i=0;i<addr.length;i++){
System.out.println("\nHost Name = "+addr[i].getHostName());
System.out.println("\nIs Reachable?? = "+addr[i].isReachable(10));
}
}
catch(Exception e){
System.out.println("\nError :"+e);
e.printStackTrace();
}
and the output I got was :
Getting Host Name ....
Host Name = 192.168.6.252
Is Reachable?? = false
But when i PING to 192.168.6.252 it replies back i.e it is reachable from my computer.
What could be the problem in above code?
Thanx in advance.