diff --git a/src/net/azib/ipscan/core/net/TCPPinger.java b/src/net/azib/ipscan/core/net/TCPPinger.java index eaea9aa8..fc8e6b2b 100755 --- a/src/net/azib/ipscan/core/net/TCPPinger.java +++ b/src/net/azib/ipscan/core/net/TCPPinger.java @@ -53,8 +53,7 @@ public class TCPPinger implements Pinger { // TODO: this means that the host is down } catch (IOException e) { - LOG.setLevel(Level.ALL); - LOG.log(Level.FINER, null, e); + LOG.log(Level.FINER, address.toString(), e); } try { diff --git a/src/net/azib/ipscan/core/net/UDPPinger.java b/src/net/azib/ipscan/core/net/UDPPinger.java index 842d41ac..c9e7a058 100755 --- a/src/net/azib/ipscan/core/net/UDPPinger.java +++ b/src/net/azib/ipscan/core/net/UDPPinger.java @@ -9,6 +9,7 @@ import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; +import java.net.NoRouteToHostException; import java.net.PortUnreachableException; import java.net.SocketTimeoutException; import java.util.logging.Level; @@ -50,12 +51,15 @@ public class UDPPinger implements Pinger { } catch (SocketTimeoutException e) { } + catch (NoRouteToHostException e) { + // TODO: this means that the host is down + } catch (IOException e) { - LOG.log(Level.FINER, null, e); + LOG.log(Level.FINER, address.toString(), e); } } - socket.disconnect(); + socket.close(); return result; }