title: python socket stays CLOSE_WAIT
body: <p>i have an application which listen on sockets. this application is monitored by nagios. the problem is, that nagios opens sockets and closes those directly.My application sockets stays in CLOSE_WAIT. And i dont understand why this happens. It should run into an error and kill the socket.</p>
  
  <pre><code>           while request=="":
                      try:
                              request = self.client.recv ( 1024 ).rstrip()
                      except socket.timeout, msg:
                                      log.error( "no request")
                                      self.client.close()
                                      return
                      except socket.error, msg:
                                      print msg
                                      self.client.close()
                                      return
                      except msg:
                                      log.error(msg)
                                      self.client.close()
                                      return
  </code></pre>
  
  <p>Any ideas how to catch this properly?</p>