Python Sockets Question

Josiah Carlson jcarlson at uci.edu
Tue Oct 26 16:03:05 EDT 2004


> Hi I am building a simple chat program but I am running into problems 
> interacting with more than one client I can send a message to a server 
> and it can recieve it no problem but how do I get more than one client 
> to see the messages as well so clients can talk to eachother basically 
> how do I get the server to send the messages back so all the clients can 
> see it

Don't use UDP, use TCP.  TCP connections are persistant, so you can send
information to all of your clients as necessary.

This will change your application, as it requires you to both read and
write from sockets.  Check out the asyncore module, or perhaps even
asynchat (which is 95% of a chat server already).

 - Josiah




More information about the Python-list mailing list