title: Unable to bind socket with my local address
body: <p>I have a <code>javax.net.SSLSocket</code> wich I initialise doing the following:</p>
  
  <pre><code>SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
  SSLSocket sslSocket = (SSLSocket) sslsocketfactory.createSocket(host, hostPort, InetAddress.getByName(localAddress), localPort);
  sslSocket.startHandshake();
  </code></pre>
  
  <p>and my client connects to the server no problem. 
  When I close the connection <code>sslSocket.close()</code> and I try to initialise a new socket using the same local address and the same host address but different host port and different local port the connection is refused and I get <code>java.net.ConnectException: Connection refused</code>:</p>
  
  <pre><code>SSLSocket sslSocket2 = (SSLSocket) sslsocketfactory.createSocket(host, hostPort2, InetAddress.getByName(localAddress), localPort2);
  sslSocket2.startHandshake();
  </code></pre>
  
  <p>What is weird is that when I try to reinitialise the new socket without binding it to my local address and port then it works fine:</p>
  
  <pre><code>SSLSocket sslSocket2 = (SSLSocket) sslsocketfactory.createSocket(host, port2);
  </code></pre>
  
  <p>anyone have any idea what is going on?</p>