I am expected to write a server that can handle multiple clients in Python, and so far I am able to deal with one connection(from a client)but I really don’t know how to extend my program to handle multiple clients. I tried looking at Twisted, but couldn’t really grasp it.
Any recommendations, or sample code that can help me understand how to handle multiple clients? Ideally, I should be able to have multiple clients connected to the server, and based on the input they pass once they are connected, I should be able to do all sort of fascinating things by parsing their input, etc.
I really look forward to your responses, and thank you in advance for your time. I’m a long time lurker.
P.S
I already looked at most other multithreading examples of Python, they didn’t quite honestly help.
Thanks.
Use SocketServer with the ThreadingMixIn so each client connection is handled on a separate thread.
Here’s a starting point for you.