The joys and jilts of non-blocking sockets

Fredrik Lundh fredrik at pythonware.com
Mon May 14 14:09:49 EDT 2001


Robert Amesz wrote:
> Perhaps I haven't made myself clear. The point I'm trying to make is
> that I'm suprised that an exception is raised for a case which is not
> exceptional at all.

If you read up on socket behaviour, you'll notice that that error
means the connection couldn't be *immediately* established.  If
that's an error or not depends on your application.

And if you look in the Python docs, you'll notice that you can use
"connect_ex" instead of "connect" if you don't want the exception.

Cheers /F





More information about the Python-list mailing list