public boolean purePing(InetAddress address) throws IOException, InterruptedException { long timeout = Math.max(1, TimeUnit.MILLISECONDS.toSeconds(networkTimeout)); // it did not work with a simple isReachable, it could be because there's no root access, so we will try ping executable if (logger.isTraceEnabled()) { logger.trace("purePing on canonical address " + address.getCanonicalHostName()); } ProcessBuilder processBuilder; if (address instanceof Inet6Address) { processBuilder = buildProcess(ipv6Command, timeout, address.getCanonicalHostName()); } else { processBuilder = buildProcess(ipv4Command, timeout, address.getCanonicalHostName()); } Process pingProcess = processBuilder.start(); readStream(pingProcess.getInputStream(), false); readStream(pingProcess.getErrorStream(), true); return pingProcess.waitFor() == 0; }
public boolean purePing(InetAddress address) throws IOException, InterruptedException { long timeout = Math.max(1, TimeUnit.MILLISECONDS.toSeconds(networkTimeout)); // it did not work with a simple isReachable, it could be because there's no root access, so we will try ping executable if (logger.isTraceEnabled()) { logger.trace("purePing on canonical address " + address.getCanonicalHostName()); } ProcessBuilder processBuilder; if (address instanceof Inet6Address) { processBuilder = buildProcess(ipv6Command, timeout, address.getCanonicalHostName()); } else { processBuilder = buildProcess(ipv4Command, timeout, address.getCanonicalHostName()); } Process pingProcess = processBuilder.start(); readStream(pingProcess.getInputStream(), false); readStream(pingProcess.getErrorStream(), true); return pingProcess.waitFor() == 0; }
public boolean purePing(InetAddress address) throws IOException, InterruptedException { long timeout = Math.max(1, TimeUnit.MILLISECONDS.toSeconds(networkTimeout)); // it did not work with a simple isReachable, it could be because there's no root access, so we will try ping executable if (logger.isTraceEnabled()) { logger.trace("purePing on canonical address " + address.getCanonicalHostName()); } ProcessBuilder processBuilder; if (address instanceof Inet6Address) { processBuilder = buildProcess(ipv6Command, timeout, address.getCanonicalHostName()); } else { processBuilder = buildProcess(ipv4Command, timeout, address.getCanonicalHostName()); } Process pingProcess = processBuilder.start(); readStream(pingProcess.getInputStream(), false); readStream(pingProcess.getErrorStream(), true); return pingProcess.waitFor() == 0; }
public boolean purePing(InetAddress address) throws IOException, InterruptedException { long timeout = Math.max(1, TimeUnit.MILLISECONDS.toSeconds(networkTimeout)); // it did not work with a simple isReachable, it could be because there's no root access, so we will try ping executable if (logger.isTraceEnabled()) { logger.trace("purePing on canonical address " + address.getCanonicalHostName()); } ProcessBuilder processBuilder; if (address instanceof Inet6Address) { processBuilder = buildProcess(ipv6Command, timeout, address.getCanonicalHostName()); } else { processBuilder = buildProcess(ipv4Command, timeout, address.getCanonicalHostName()); } Process pingProcess = processBuilder.start(); readStream(pingProcess.getInputStream(), false); readStream(pingProcess.getErrorStream(), true); return pingProcess.waitFor() == 0; }
public boolean purePing(InetAddress address) throws IOException, InterruptedException { long timeout = Math.max(1, TimeUnit.MILLISECONDS.toSeconds(networkTimeout)); // it did not work with a simple isReachable, it could be because there's no root access, so we will try ping executable if (logger.isTraceEnabled()) { logger.trace("purePing on canonical address " + address.getCanonicalHostName()); } ProcessBuilder processBuilder; if (address instanceof Inet6Address) { processBuilder = buildProcess(ipv6Command, timeout, address.getCanonicalHostName()); } else { processBuilder = buildProcess(ipv4Command, timeout, address.getCanonicalHostName()); } Process pingProcess = processBuilder.start(); readStream(pingProcess.getInputStream(), false); readStream(pingProcess.getErrorStream(), true); return pingProcess.waitFor() == 0; }
public boolean purePing(InetAddress address) throws IOException, InterruptedException { long timeout = Math.max(1, TimeUnit.MILLISECONDS.toSeconds(networkTimeout)); // it did not work with a simple isReachable, it could be because there's no root access, so we will try ping executable if (logger.isTraceEnabled()) { logger.trace("purePing on canonical address " + address.getCanonicalHostName()); } ProcessBuilder processBuilder; if (address instanceof Inet6Address) { processBuilder = buildProcess(ipv6Command, timeout, address.getCanonicalHostName()); } else { processBuilder = buildProcess(ipv4Command, timeout, address.getCanonicalHostName()); } Process pingProcess = processBuilder.start(); readStream(pingProcess.getInputStream(), false); readStream(pingProcess.getErrorStream(), true); return pingProcess.waitFor() == 0; }
public boolean purePing(InetAddress address) throws IOException, InterruptedException { long timeout = Math.max(1, TimeUnit.MILLISECONDS.toSeconds(networkTimeout)); // it did not work with a simple isReachable, it could be because there's no root access, so we will try ping executable if (logger.isTraceEnabled()) { logger.trace("purePing on canonical address " + address.getCanonicalHostName()); } ProcessBuilder processBuilder; if (address instanceof Inet6Address) { processBuilder = buildProcess(ipv6Command, timeout, address.getCanonicalHostName()); } else { processBuilder = buildProcess(ipv4Command, timeout, address.getCanonicalHostName()); } Process pingProcess = processBuilder.start(); readStream(pingProcess.getInputStream(), false); readStream(pingProcess.getErrorStream(), true); return pingProcess.waitFor() == 0; }