I use epoll linux server for multiplexing. I noticed that the request to close the connection occurs in two ways:
- the EPOLLHUP event fires
- recv returns 0
It’s not entirely clear to me what the client should do so that we get EPOLLHUP on the server, and it’s also not clear what the client should do so that we get 0 on the server with recv.
I just need to close the connection in the right way, but I don't know how.