The list of methods to do Host Ping are organized into topic(s).
boolean
ping(String host) Checks if the Host is Reachable
try {
return InetAddress.getByName(host).isReachable(100);
} catch (IOException e) {
return false;
boolean
ping(String host, int timeout) ping
pingErrorMessage = "No Error";
try {
InetAddress address = InetAddress.getByName(host);
return address.isReachable(timeout);
} catch (Exception e) {
pingErrorMessage = e.getMessage();
return false;
void
Ping(String host, int timeout) Tes apakah host/IP bisa dihubungi
try {
if (InetAddress.getByName(host).isReachable(timeout)) {
System.out.printf("%s is reachable %n", host);
} else {
System.out.printf("%s is unreachable %n", host);
} catch (UnknownHostException ex) {
System.out.printf("Unknown host: %s%n", host);
...
boolean
ping(String host, int timeout) ping
InetAddress address = null;
try {
address = InetAddress.getByName(host);
} catch (UnknownHostException e) {
e.printStackTrace();
return false;
boolean b = false;
...