client server question

Robert Wierschke wierob at gmx.de
Mon Aug 15 05:43:21 EDT 2005


John schrieb:
> I have a simple script that runs a server where one client can connect.
> I would like to make it so that many clients can connect to one server
> on the same port. Where can I find how to do this?
> 
> Thanks,
> --j
> 

use sockets.

the socket accept mehtoh returns a new socket  (so now you hava one 
"server socket" and a connection between to "client sockets" one used by 
the requesting client and one created at the server side (retrund from 
accept)  ). you should start a new thread/process with this new socket 
to handle the client request and use the "old" server socket again with 
the accept method to wait for the next client to connect.



More information about the Python-list mailing list