Python Forum

Full Version: Connection handling
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi folks.

I have the following code running in a loop for accepting socket connections...
clientsocket, clientaddr = serversocket.accept()
clients.append(clientsocket)
thread.start_new_thread(handler, (clientsocket, clientaddr))

This works fine, but there is a huge CPU hole when clients disconnect. Now, I'm obviously not checking the clients list to see if anyone has dropped.

How do I do that?

Many thanks.