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
#2
don't you mean socketserver? see: https://docs.python.org/3.4/library/socketserver.html
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Star python exception handling handling .... with traceback mg24 3 1,219 Nov-09-2022, 07:29 PM
Last Post: Gribouillis
  Serial connection connection issue Joni_Engr 15 7,838 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