extend comments on HUP vs RDHUP
This commit is contained in:
parent
f9a7d6ec6f
commit
cab81d3fa9
2 changed files with 5 additions and 1 deletions
|
@ -71,6 +71,9 @@ pub struct EpollReadyEvents {
|
|||
pub epollrdhup: bool,
|
||||
/// For stream socket, this event merely indicates that the peer
|
||||
/// closed its end of the channel.
|
||||
/// Unlike epollrdhup, this should only be set when the stream is fully closed.
|
||||
/// epollrdhup also gets set when only the write half is closed, which is possible
|
||||
/// via `shutdown(_, SHUT_WR)`.
|
||||
pub epollhup: bool,
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,8 @@ impl FileDescription for SocketPair {
|
|||
epoll_ready_events.epollout = true;
|
||||
}
|
||||
} else {
|
||||
// Peer FD has been closed.
|
||||
// Peer FD has been closed. This always sets both the RDHUP and HUP flags
|
||||
// as we do not support `shutdown` that could be used to partially close the stream.
|
||||
epoll_ready_events.epollrdhup = true;
|
||||
epoll_ready_events.epollhup = true;
|
||||
// Since the peer is closed, even if no data is available reads will return EOF and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue