asynchat - operation could not complete w/ blocking

Fredrik Lundh fredrik at pythonware.com
Wed Mar 8 07:29:06 EST 2006


"Andreas R." wrote:

>>> I'm using Python's asynchat module for networking.
>>> When calling the sendall() method of asynchat,
>>> I sometimes get the error message "the operation
>>> could not complete without blocking".

>>
>> what sendall method ?  to get proper output buffering with asynchat, use

>> "push" (or "push_with_producer").
>
> The problem I was having with push, is that is does not always send
> complete packages.

that sounds like a bug on the receiving side.  the network layer is free
to split things up however it likes, and it's up to your code to put things
together again properly.

> The solution to this was to use sendall() instead, but sendall() gives
> blocking error messages.

sendall is blocking per definition (and it doesn't send complete packages
either; it just loops until it has managed to hand everything over to the net-
work layer).

</F> 






More information about the Python-list mailing list