Re: epoll, POLLHUP, and packet loss

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 9 Oct 2003, Dan Kegel wrote:

> Stop me if you've heard this one before.
>
> We're using a very old epoll patch (ep_patch-2.4.18-0.32),
> and have noticed that if there is a dropped TCP packet
> followed by a FIN, epoll says the socket is ready for
> POLLHUP *before* all the data has been read from the socket.
> As a workaround, we are ignoring POLLHUP and simply reading
> until we get EOF; this solves the problem nicely.

Hi Dan. The POLLHUP is a condition that does not preclude the socket to
have data to be still read. The correct approach, with both and new epoll,
is to register the event and read until data is available (if you need
to). Then, if a POLLHUP has been received, do not go to wait for POLLINs.



- Davide

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux