How to make a simple multithreaded socket server in Python that remembers clients

You can use a thread per client to avoid the blocking client.recv() then use the main thread just for listening for new clients. When one connects, the main thread creates a new thread that just listens to the new client and ends when it doesn’t talk for 60 seconds. import socket import threading class ThreadedServer(object): … Read more