[cse491] nonblocking

Alex Nolley nolleyal at msu.edu
Sat Sep 13 21:58:26 PDT 2008


Hey I'm having some trouble understanding how the echo server and webserver
can accept multiple concurrent connections using only the nonblocking
method. Right now my nb echo server code has a while loop that handles the
sock.accept() in a try/except statement. If a client connects, the
client_sock is set to nonblocking and then a nested while loop is entered
that handles the conversation with that client. It works well enough if one
client connects at a time but it doesn't handle multiple concurrent
connections. My questions is, if we can't use multithreading, how do we
accept new connections and handle existing connections at the same time?

 

Thanks,

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/cse491-fall-2008/attachments/20080914/4365d3b7/attachment.htm 


More information about the cse491-fall-2008 mailing list