title: Is there a minimum timeout to InetAddress isReachable method?
body: <p>I'm having a weird behavior with the <code>isReachable</code> method of <code>InetAddress</code> class.</p>
  
  <p><a href="https://docs.oracle.com/javase/7/docs/api/java/net/InetAddress.html#isReachable(int)" rel="nofollow noreferrer">Method prototype</a> is :</p>
  
  <pre><code>public boolean isReachable(int timeout)
  </code></pre>
  
  <ul>
  <li>When using a <strong>timeout > 1500 (ms)</strong>, the method waits the exact time
  given as argument (if the target IP is not reachable of course...).</li>
  <li>When using <strong>timeout &lt; 1500</strong>, the method waits 1000ms maximum...</li>
  </ul>
  
  <p>The code is quite simple :</p>
  
  <pre><code>    InetAddress addr = null;
      String ip = "10.48.2.169";
  
      try {
          addr = InetAddress.getByName(ip);
      } catch (UnknownHostException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      Timestamp s = new Timestamp(System.currentTimeMillis());
      System.out.println(s + "\t Starting tests :");
  
      pingTest(addr, 100);
      pingTest(addr, 500);
      pingTest(addr, 1000);
      pingTest(addr, 1500);
      pingTest(addr, 2000);
      pingTest(addr, 2500);
  </code></pre>
  
  <p>Where pingTest is defined by :</p>
  
  <pre><code>public static void pingTest(InetAddress addr, int timeout) {
          boolean result = false;
          try {
              result = addr.isReachable(timeout);
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          Timestamp s = new Timestamp(System.currentTimeMillis());
          System.out.println(s + "\t (" + timeout + ") " + addr.toString() + " " + result);
      }
  </code></pre>
  
  <p>Then the output is :</p>
  
  <pre><code>2017-09-07 16:45:41.573  Starting tests :
  2017-09-07 16:45:42.542  (100) /10.48.2.169 false
  2017-09-07 16:45:43.542  (500) /10.48.2.169 false
  2017-09-07 16:45:44.541  (1000) /10.48.2.169 false
  2017-09-07 16:45:46.041  (1500) /10.48.2.169 false
  2017-09-07 16:45:48.041  (2000) /10.48.2.169 false
  2017-09-07 16:45:50.541  (2500) /10.48.2.169 false
  </code></pre>
  
  <p>So the question is : <strong>Is there a minimum timeout to InetAddress isReachable method ?</strong> (like 1500 in my doubt, but I doubt, huge timeout...)</p>
  
  <p>Or maybe I just made a huge mistake that I still miss...</p>
  
  <p>Tell me if this isn't clear enough.</p>
  
  <p>Thanks for your help and thoughts.</p>