title: How to release socket?
body: <p>I'm making a little tcp server and it processes a number of requests via threads. 
  When my server is shutting down he leaves unclosed sockets. 
  How can I close them automaticaly or somehow release on new launching of my server? 
  The number of sockets is big and I don't want to manage them by hands. </p>
  
  <p>Any ideas?</p>