title: Socket not connecting after first connection failure
body: <p>I don't understand why the following program doesn't work when the initial connect fails (I intentionally start the server socket after the first connect fails):</p>
  
  <pre><code>Socket client = new Socket();
  while (true) {
      try {
          client.connect(address);
          break;
      } catch (IOException e) {
           Thread.sleep(1000);
      }
  }
  </code></pre>
  
  <p>If I move the <code>client = new Socket();</code> inside the while loop, it works, but I couldn't find anything in the documentation that states that if an initial connect fails the socket is "broken" and has to be recycled.</p>