Java failed to reach to a PC in local LAN
I tried to execute the following code
and the output I got was :
NetworkInterface ni = NetworkInterface.getByName("eth0");
System.out.println("\nGetting Host Name ....");
InetAddress addr = InetAddress.getAllByName("192.168.6.252");
System.out.println("\nHost Name = "+addr[i].getHostName());
System.out.println("\nIs Reachable?? = "+addr[i].isReachable(10));
But when i PING to 192.168.6.252 it replies back i.e it is reachable from my computer.
Getting Host Name ....
Host Name = 192.168.6.252
Is Reachable?? = false
What could be the problem in above code?
Thanx in advance.