IpCheckService
public class IpCheckService{
@Async(value="asyncIpCheckExecutor")
public void asyncIpCheck(String ipAdress,Map<String,Boolean> map,CountDownLatch latch){
try{
InetAdress adress=InetAdress.getByName(ipAdress);
map.put(ipAdress,true);
if(address.isReachable(3000)){
map.put(ipAdress,false);}
}catch(Exception e){
log.error("IP校验异常",e);
throw new TitanException("IP校验异常",e);
}finally{
latch.countDown();
}
}
}