[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] Mixing edge-triggered and level-triggered events



I am using libevent-2.0.18-stable running on Linux (CentOs 6.2) to implement an HTTP proxy.
For each connection I define: (i) an edge-triggered read event and (ii) a socket-based bufferevent with EV_WRITE enabled and EV_READ disabled.

Using strace I see that adding the first event calls:
epoll_ctl(52, EPOLL_CTL_ADD, 78, {EPOLLIN|EPOLLET, {u32=78, u64=78}}) = 0

And adding the bufferevent results in
epoll_ctl(52, EPOLL_CTL_MOD, 78, {EPOLLIN|EPOLLOUT, {u32=78, u64=78}} <unfinished ...>
<... epoll_ctl resumed> ) = 0

Allegedly the EPOLLET flag was reset but it seems that the read-event still behaves edge-triggered and the bufferevent also functions as expected.
Using event_enable_debug_mode() generates a warning and the events do not function properly at all.

My questions:
1. Can bufferevent be configured to work edge-triggered?
2. What are the implications of this inconsistency?
3. How come I keep getting edge-triggered behavior on the read event?


Thanks,
Avi


This transmission may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.