Digest Number 1946
Alex Martelli
aleaxit at yahoo.com
Fri Mar 23 03:34:31 EST 2001
"Fredrik Lundh" <fredrik at pythonware.com> wrote in message
news:dxCu6.3134$4N4.460882 at newsc.telia.net...
[snip]
> nothing's going wrong here -- the system's reminding you that
> when you're using non-blocking mode, the fact that connect
> returns doesn't mean that it has succeeded yet.
Excellent summary!
> you're supposed to catch that exception, and check for com-
> pletion using select or poll. see your favourite socket pro-
> gramming guide for more info.
Very good Python example code can be found as a part of
the extremely-useful timeoutsocket module at:
http://www.timo-tasi.org/python/timeoutsocket.py
(It needs some fixes for at least some versions of NT, but
I haven't heard back from the author after submitting them;
still, it's SO useful that, after using it as an example of
how to work with non-blocking sockets, one may almost forget
that and use timeoutsocket's directly all of the time...!-).
Akex
More information about the Python-list
mailing list