Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Newsgroups: comp.os.linux.development.apps From: Christof Meerwald Subject: Re: Strange EPOLLOUT|EPOLLET behaviour (spurious events) References: <87ehrbmpg8.fsf@sapphire.mobileactivedefense.com> Organization: Hacking@Home X-PGP-Key: 1024D/2B10BE68, 1998-06-29 X-PGP-Fingerprint: 0289 5466 C1F5 B03C DBA7 6304 8CAF 9782 2B10 BE68 User-Agent: slrn/pre1.0.0-16 (Linux) Message-ID: Cancel-Lock: sha1:btg62cgNG2/xVfJtlYUmItffhi4= X-NNTP-Posting-Host: localhost Date: 26 Apr 2012 06:01:40 GMT Lines: 34 NNTP-Posting-Host: 84.200.12.152 X-Trace: news.sunsite.dk DXC=Clhi3MVAZn:1@QH[VaTAe9YSB=nbEKnk;1]U`^^g71K?8`CEJGOoTk?aTD[Ib Christof Meerwald writes: >> But as I am using EPOLLET, I wouldn't expect to get any EPOLLOUT >> events on that socket as send never returns EAGAIN (and there isn't >> any state transition). > That's expected behaviour: You get EPOLLOUT as soon as 'a send > operation' completed. Well, that's what appears to be happening, but is it documented anywhere? Looking at http://linux.die.net/man/7/epoll I see: "The suggested way to use epoll as an edge-triggered (EPOLLET) interface is as follows: with nonblocking file descriptors; and by waiting for an event only after read(2) or write(2) return EAGAIN." and "Do I need to continuously read/write a file descriptor until EAGAIN when using the EPOLLET flag (edge-triggered behavior)? Receiving an event from epoll_wait(2) should suggest to you that such file descriptor is ready for the requested I/O operation. You must consider it ready until the next (nonblocking) read/write yields EAGAIN." Nothing there suggests that I should get an EPOLLOUT as soon as "a send operation" completed. Christof -- http://cmeerw.org sip:cmeerw at cmeerw.org mailto:cmeerw at cmeerw.org xmpp:cmeerw at cmeerw.org