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
Post a Comment