Here you can find the source of isReachable(NetworkInterface iface, InetAddress address, int timeout)
public static boolean isReachable(NetworkInterface iface, InetAddress address, int timeout)
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.net.InetAddress; import java.net.NetworkInterface; public class Main { public static boolean isReachable(NetworkInterface iface, InetAddress address, int timeout) { try {/* w ww .j a va 2s. co m*/ return address.isReachable(iface, 0, timeout); } catch (IOException e) { return false; } } }