networking - 'ip route get' in Java -


how can know whether ip address theoretically accessible? want java code behave following linux invocation:

 # ip route 192.168.36.5 rtnetlink answers: network unreachable 

where no timeout parameter accepted because doesn't try connect ip address. determines if address reachable according system's routing table.

in java can execute shell comands using exec() method. see if code below helps:

 runtime.getruntime().exec("ip route 192.168.36.5"); 

Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -

javascript - How to change image src on success AJAX -