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();
}
}
}

posted @ 2024-11-15 10:30  一曲微茫  阅读(2)  评论(0编辑  收藏  举报