or do I need to watch too for the return values of read() or write() to know when to close a socket
or it depends on some flags?
this question is for epoll in edge triggered mode
Asked
Active
Viewed 283 times
0

porente
- 371
- 2
- 14
1 Answers
0
epoll_wait() will not report a close(soc) if it is called on your process. It will instead silently remove the socket from the epoll set.
I would monitor for EPOLLHUP, EPOLLRDHUP and EPOLLIN to detect closure. Regardless, if there is a remote closure, you should get an event though, either EPOLLIN, EPOLLHUP or EPOLLERR.

Peter
- 98
- 6