[Twisted-Python] Modifying Echo example

Renan Mathias Fernandes renan at renanfernandes.org
Mon Mar 1 14:16:38 EST 2010


I am trying to learn about Twisted Matrix, and for that I am modifying the Echo Client & Server example to archive few goals:
From now, I have modified this example to: Make the client send some requests and have the server reply for each request.
So, for example: if the client sends "Hello!", the server will reply : "Hello, [ip address of client]".
But my point is: I can handle the communication between 1 server and 1 client only, but how Can I do if I have multiple clients connected?
My objective is: I have 4 clients connected, and I want the server to send a data to only one specific client (I will provide the ip address and port for this specific client)
I imagine that The correct way to do this is: having one thread for each client connection, and calling that specific thread to write down a message, am I correct?

Does someone has an example on how can I do that?

Thanks in advance,

Renan Mathias Fernandes

More information about the Twisted-Python mailing list