non blocking socket.accept()

Michael Gilfix mgilfix at eecs.tufts.edu
Mon Jun 17 11:59:02 EDT 2002


  Someone else answered what you'll want to do with earlier versions
of python but if you're feeling adventurous and want to try out
the CVS version:

   sock.set_timeout(2.0)
   try:
       sock.accept()
   except socket.error, strerror:
       print strerror

                    -- Mike

On Mon, Jun 17 @ 13:45, Zsolt Marx wrote:
> I far as I know socket.accept() waits for a client
> to ask for a connection with the server.
> 
> This command seems to be blocking, though I would
> like to limit the wait time onto a predefined interval
> and to throw an error, if there is no connection.

-- 
Michael Gilfix
mgilfix at eecs.tufts.edu

For my gpg public key:
http://www.eecs.tufts.edu/~mgilfix/contact.html





More information about the Python-list mailing list