Wednesday, 24 August 2016

[Java] How to ping IP address in java (자바에서 Ping 구현)

1
2
3
4
5
public static boolean ping( String host, int milisecondTimeout) throws UnknownHostException, IOException {
  java.net.InetAddress address = InetAddress.getByName( host);
  return address.isReachable( milisecondTimeout);
  
}

No comments:

Post a Comment