client derived from async_chat

Erik Max Francis max at alcyone.com
Mon Aug 18 00:48:22 CEST 2003


Patrick Useldinger wrote:

> This is exactly what seems to happen with the async_chat class, as in
> dispatcher.create_socket the same setblocking(0) is done.
> 
> If you just could shed some light on what this error means, I haven't
> found any explanation up to now.

It'd doing what you asked it to do.  Functions that would block return
an error of EWOULDBLOCK (which is translated into a socket.error
exception in Python) if they would have blocked but you have set the
socket not to block.  The error is not an error, it's just the system
telling you, "I would have blocked here, but you told me not to, so I'm
telling you that."

The bigger question is why you're asking the socket to not block when it
appears that you really want it to (since your logic isn't handling the
case when it doesn't).

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ Defeat is a school in which truth always grows strong.
\__/  Henry Ward Beecher




More information about the Python-list mailing list