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?