I want to get an example or suggestion of how to use InetAddress in windows systems with firewall active. I don't know what is blocked by the firewall that isn't allowing this class in windows to work.
When I try to use this code in windows with firewall disabled I get the host name and isReachable
to true:
InetAddress addrs = null;
try {
addrs = InetAddress.getByName("192.168.1.1");
System.out.println(addrs.getHostName());
System.out.println(addrs.isReachable(100));
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
But activating firewall I get false
, I can use policy for this?