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.
request = self.client.recv ( 1024 ).rstrip()
except socket.timeout, msg:
log.error( "no request")
except socket.error, msg:
CLOSE_WAIT state means that the socket is expected to be closed by the application.
In the code you posted the socket is only closed on exception. Make sure you close the socket when it receives
EOF, i.e. check for
not request before stripping it.