1

I would like to know how to make it possible for a python server to wait for messages from 2 clients without any pre-assumption as to who would be messaging first. Can I do something like-- message=client.recv(BUFSIZ) or targetsoc.recv(BUFSIZ) Can I try something like this where both targetsoc and client are client sockets connected to each other and I donno who would be messaging first?

I basically want to be able to listen for data from both the clients simultaneously without any order or priority...

  • Use [select](http://pymotw.com/2/select/). – Mark R. Feb 19 '15 at 15:26
  • 1
    I mean I need to let both the clients in a connection send messages and the order of communication need not be fixed or pre-empted....Is the above method valid? like can I keep both the sockets alive simultaneously and see which one sends a message first? – Sandeep Hari Hara Bhat Feb 19 '15 at 15:42

0 Answers0