Communicating with multiple clients using one TCP socket pyt

Ian Kelly ian.g.kelly at gmail.com
Mon Mar 30 17:13:47 EDT 2015


On Mon, Mar 30, 2015 at 2:43 AM, bobbdeep <anudeepsm at gmail.com> wrote:
> Also, when once client is connected to the server, the other cannot connect to the server. Any ideas on how to do this ?

While one client is connected, the server can't accept new connections
because it's tied up in a blocking call to recv, waiting for data. In
order to accept additional simultaneous connections while handling the
incoming data as it becomes ready, you'll need to multiplex your I/O
events using the select module -- see
https://docs.python.org/2/library/select.html#select.select

Also, if you don't already have a book on network programming, I
suggest getting one.



More information about the Python-list mailing list