On 12/14/05, Tassilo von Parseval <[EMAIL PROTECTED]> wrote:
> And I have one small question with EV_READ|EV_WRITE events: Am I correct
> in assuming that an event-handlers second argument, being the type of
> event, can be the bitwise ORing of these two when the fd can both be
> read from and written to? So far I always assumed it's either but not
> both of them so I used '==' instead of '&' to test which event occured.
> This is also what libevent's manpage implies:
>
>     The function fn will be called with the file descriptor that
>     triggered the event and the type of event which will be either
>     EV_TIMEOUT, EV_SIGNAL, EV_READ, or EV_WRITE.

The API allows you to or EV_READ and EV_WRITE together.  You will have
to test EV_READ and EV_WRITE readiness separately in your callback. 
If you specify a timeout on an event, then you also need to test for
EV_TIMEOUT in the same callback.

Hope this helps,

Niels.

_______________________________________________
Libevent-users mailing list
[email protected]
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to