boolean pingable = false;
String[] ips = StringUtils.split(ip,".");
byte[] addr2 = new byte[ips.length];
for(int i=0,j; i
addr2[i]=(byte)j;
}
try {
pingable = InetAddress.getByAddress(addr2).isReachable(1500);
} catch (UnknownHostException e) {
pingable = false;
log.error(ip + " Indexer Host not reachabe.");
} catch (IOException e) {
pingable = false;
log.error(ip + " Indexer Host not reachabe.");
}
return pingable;
}
No comments:
Post a Comment