The question is straightforward. The
shutdown(..., SHUT_RD) was called on the socket after
read has returned
epoll_wait keeps sending me
EPOLLIN event for the socket.
I know I can, and must do, in my situation, call
epoll_ctl to modify the event mask. Naive thoughts lead me to think that, if
close removes record from the
epoll list, then
shutdown had to mark appropriate socket end.
The question is, semantically, why
epoll_wait do report me with read available, given that
0 socket were shut down for reading?
epoll_wait() will report
EPOLLIN if trying to read from the socket would return immediately rather than blocking.
Once you do
shutdown(..., SHUT_RD); all calls to
0 immediately. Since it won’t block,
epoll_wait() reports that the socket is readable.