lkml.org 
[lkml]   [2009]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: PROBLEM: Epoll frequently fails to notify connects at connect bursts
From
On Wed, Aug 26, 2009 at 3:24 AM, Davide Libenzi<davidel@xmailserver.org> wrote:
> On Tue, 25 Aug 2009, Davide Libenzi wrote:
>
>> Multiple quasi-simultaneous events for the same fd are merged. This is why
>> on POLLIN on accepting sockets you want to do something like:
>>
>>       while ((afd = accept(sfd, ...)) != -1)
>>               add_client(afd);
>
> Of course, with  sfd  in non-blocking mode. Alternatively, you drop EPOLLET
> for the  sfd  socket.
>

Aha! Thank you immensely Davide. It cost me one week of frustration already.

1. Where should I have picked up this gem of essential information? I
haven't seen it in the man-pages for either 'epoll' or 'accept'.

2. Is it better to use a level-triggered listener socket, or to use
the accept-loop?

Thanks a million,
Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-08-26 11:17    [W:0.070 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site