Java examples for Network:Ping
ping a Host
//package com.java2s; import java.net.InetAddress; public class Main { public static boolean ping(String host, int connectTimeOut) { InetAddress address;//from w w w . j a va2 s. c om try { address = InetAddress.getByName(host); return address.isReachable(connectTimeOut); } catch (Exception e) { return false; } } }