title: How to recover when server socket exits from listening
body: <p>In this application I have a server socket which waits for clients to connect. My problem is when there is a runtime exception while listening socket exit from listening. So clients cannot connect to the system. So I need to restart the server. Until that clients cannot connect. Following I have shown part of my code.</p>
  
  <pre><code>private Socket socket;
  private SSLServerSocket ssocket; 
  private int port=6666;
  
  //here I have code need to create a serversocket
  
  while (listen) {
      //wait for client to connect//  
      try{
          socket = ssocket.accept();
      } catch (IOException ioe) {
          ioe.printStackTrace();
      }      
  }
  </code></pre>
  
  <p>Can any one suggest me a way to relisten to the same port without restarting the server if an exception occured?  </p>