How does libev invoke an io watcher if both EV_READ and EV_WRITE are pending?

Marc Lehmann schmorp at schmorp.de
Thu Jul 30 19:19:51 CEST 2015


On Thu, Jul 30, 2015 at 11:48:00PM +0800, Cheyi Lin <cheyi.lin at gmail.com> wrote:
> If both EV_READ and EV_WRITE are pending, libev will ...
> 
> 1) invoke the callback twice, one is for EV_READ, the other is for EV_WRITE.
> 2) invoke the callback once, revents |= (EV_READ | EV_WRITE).
> 
> Which is correct? Thanks.

2 - watcher callbacks always receive _all_ pending events.

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



More information about the libev mailing list