Loading... public static boolean ping(String ipAddress) throws Exception{ int timeOut=3000; boolean status= InetAddress.getByName(ipAddress).isReachable(timeOut); // 当返回值是true时,说明host是可用的 return status; } Last modification:August 16, 2021 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 如果觉得我的文章对你有用,请随意赞赏