Re: POLLRDONCE optimisation for epoll users (was: epoll and half closed TCP connections)

From: Davide Libenzi (davidel@xmailserver.org)
Date: Sun Jul 13 2003 - 23:00:00 EST


On Mon, 14 Jul 2003, Jamie Lokier wrote:

> (a) fd isn't a socket
> (b) fd isn't a TCP socket

Jamie, libraries, like for example libevent, are completely generic indeed.
They fetch events and they call the associated callback. You obviously
know inside your callback which kind of fd you working on. So you use the
reading function that best fit the fd type. Obviously the read(2) trick
only works for stream type fds.

> (c) kernel version <= 2.5.75

Obviously, POLLRDHUP is not yet inside the kernel :)

> (d) SO_RCVLOWAT < s

This does not apply with non-blocking fds.

> (e) there is urgent data with OOBINLINE (I think)

You obviously need an EPOLLPRI check in your read handling routine if you
app is expecting urgent data.

- Davide

-
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/



This archive was generated by hypermail 2b29 : Tue Jul 15 2003 - 22:00:50 EST