title: server socket loose binding
body: <p>I want to develop master server and secondary server. </p>
  
  <p>When the master server is down secondary server should come up on the same port. </p>
  
  <p>But when master server is ready to start secondary server should gracefully stop so that master server can start on the same port. </p>
  
  <p><strong>Is there any way secondary server can know that another process is trying to start on the same port?</strong></p>