Why do we need EPOLLRDHUP when EPOLLHUP seems enough?

我的未来我决定 提交于 2020-01-24 03:31:11

问题


According to the linux man page,

EPOLLHUP

When reading from a channel such as a pipe or a stream socket, this event merely indicates that the peer closed its end of the channel.

EPOLLRDHUP

Stream socket peer closed connection, or shut down writing half of connection.

I can hardly tell any difference between EPOLLHUP and EPOLLRDHUP.

To me, whenever EPOLLRDHUP is used EPOLLHUP can be used instead with the same semantics.

Am I right? If not, any explanations?

来源:https://stackoverflow.com/questions/51833215/why-do-we-need-epollrdhup-when-epollhup-seems-enough

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!