[eio] Bug breaking on maxreqs

Marc Lehmann schmorp at schmorp.de
Tue Jan 5 20:23:01 CET 2010


On Tue, Jan 05, 2010 at 08:59:10AM -0800, ry at tinyclouds.org wrote:
> > Are you sure you keep invoking etp_poll until done_poll_cb has been
> > called?
> 
> No - I guess I'm doing it wrong: I'm using ev_async and calling
> ev_async_send() on each want_poll call. The ev_async callback simply
> calls eio_poll(). done_poll_cb is ignored in my app.

Indeed, that's the problem, the protocol is stateful.

An easy way to implement this is to start an idle watcher in your async
cb, and stopping it either when the done_cb is called or poll_cb returns 0
--- or restarting your async watcher when poll_cb returns -1.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list