Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connection handling
#1
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.
Reply


Messages In This Thread
Connection handling - by MuntyScruntfundle - Dec-05-2017, 11:35 AM
RE: Connection handling - by Larz60+ - Dec-05-2017, 11:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Star python exception handling handling .... with traceback mg24 3 1,337 Nov-09-2022, 07:29 PM
Last Post: Gribouillis
  Serial connection connection issue Joni_Engr 15 8,332 Aug-30-2021, 04:46 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020