Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8254157

InetAddress isReachable returns false for reachable known host

XMLWordPrintable

      InetAddress isReachable fails with jdk7u but passes with jdk8u.

      Sample Program:

      import java.net.InetAddress;

      public class Test {
      public static void main(String[] args) {
      try {
                  final InetAddress addr = InetAddress.getByName("hostname");
                  final boolean isReachable = addr.isReachable(2000);
                  if (!isReachable) {
                      System.out.println("Not Reachable");
                  } else {
                      System.out.println("Reachable");
                  }
      } catch (Exception e) {
                  e.printStackTrace();
      }
      }
      }

      Excepted: Reachable
      Actual: Not Reachable

            kravikumar Kiran Sidhartha Ravikumar (Inactive)
            shadowbug Shadow Bug
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: