mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-03 00:00:05 +02:00
Using Linux's `epoll(7)` interface, a `EPOLLHUP` condition is signalled for the reading end of a pipe or socket when the other end is closed for writing. This may happen in combination with `EPOLLIN` being signalled (if further data is available for reading), or with `EPOLLIN`. If `EPOLLHUP` is signalled without `EPOLLIN` it indicates an immediate EOF condition, which will result in the next `read()` suceeding with 0 bytes read. It is thus not required to handle `EPOLLHUP` specially in the reader, but we need to indicate readiness upon encountering it. Looking at the `kqueue` and `windows` mio backends, they seem to be turn a detected EOF and connection reset into `mio::Ready::hup()` events, so it may be reasonable to speculate that this change is an improvement for these platforms as well. Fixes #117.