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

[Libevent-users] Ticket #70 - Support for epoll's EPOLLRDHUP



Hi,

I'm working on a patch to add support for epoll's EPOLLRDHUP flag to libevent. This is a feature requested on ticket #70[1].

The first version of the patch is attached to that issue and it already makes it possible to identify when a client prematurely closes the other end of the socket. Unfortunately with the current EV_* flags it's not possible to tell the programmer that this happened so he can act accordingly without recv()'ing all the pending data.

I've done some research and I found out that nginx added a flag named 'pending_eof' when it detected EPOLLRDHUP, making possible to close that socket as fast as possible without reading the pending data.[2]

I would like to ask some opinions on how we can add support for this kind of feature on libevent? My suggestion is to add a new flag, probably named EV_EOF, so the programmer can act accordingly. From what I've seen, it seems that kqueue also have a mechanism for detecting such premature closes. I can also add support for kqueue if necessary.

What do you guys think?
Thanks.

[1] https://sourceforge.net/p/levent/feature-requests/70/
[2] http://trac.nginx.org/nginx/ticket/320

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