-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add epoll EPOLLHUP flag support #3814
Conversation
@rustbot ready |
@@ -69,17 +69,21 @@ pub struct EpollReadyEvents { | |||
/// Stream socket peer closed connection, or shut down writing | |||
/// half of connection. | |||
pub epollrdhup: bool, | |||
/// For stream socket, this event merely indicates that the peer | |||
/// closed its end of the channel. | |||
pub epollhup: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, there's some subtle difference between RDHUP and HUP. But I don't really understand it... and it seems we are ignoring that difference and setting the two flags together. Could that become a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding, EPOLLRDHUP is more specific than EPOLLHUP. It will be returned even when the peer only closing its writing half. Closing wriitng half will require shutdown
.
For example,
If we use shutdown(sv[1], SHUT_WR);
only EPOLLRDHUP
will be triggered. If we use shutdown(sv[1], SHUT_RDWR);
or close(sv[1])
, both EPOLLHUP
and EPOLLRDHUP
will be triggered.
Since we don't have shutdown
for now, I think they will have the same behaviour.
@bors r+ |
☀️ Test successful - checks-actions |
Related discussion in #3811 (comment).
This PR added support for
EPOLLHUP
flag.