title: Socket Bind Error
body: <p>I have a test application that opens a socket , sends something through this socket and then closes it . This is done in a loop for 5-10.000 times. The thing is that after 3,4000 iterations I get an error of this type :</p>
  
  <pre><code>java.net.BindException: Address already in use: connect
  </code></pre>
  
  <p>I even set the socket to be used immediattly, but the error persists</p>
  
  <pre><code>try
  {
       out_server.write(m.ToByteArray());
       socket_server.setReuseAddress(true);
       socket_server.close();
  }
  catch(Exception e)
  {
       e.printStackTrace();
       System.out.println(i+" unable to register with the server");
  }
  </code></pre>
  
  <p>What could I do to fix this ?   </p>