January 21st, 2005, 02:25 PM
I've got a socket server that is built to handle some basic requests, and send back some data to the client. The problem is, that over time, the number of open file handles for my process, keeps increasing--2(one read,one write) for each request the server recieves. I am wondering if I am running the server, and not handling the closing of sockets well(if at all). See code below.
FYI -on the client side, I am ending requests with a socket.shutdown(2) --but it does not seem to matter what method I use to close the client side, the server side still leaves the open file handles.
I am implementing it in this fashion:
s = SocketServer.TCPServer((host,port),reader)
data = self.request.recv(7)
if data == "how r u":
send = "fine"
I am sure this will be obvious to anyone familiar with this, but I am at a loss on how to clean up these open file handles.
Thanks in advance for any input you have--