Reputation: 3013
I am working on a network programming using epoll. I was wondering how I can handle client disconnect. I read api document and epoll_wait had a argument for timeout. However, I was confused if the time out for the epoll_wait function or for the client that are being connected.
Thanks in advance..
Upvotes: 1
Views: 1175
Reputation: 72
timeout specified is for epoll_wait. To handle client disconnect, Handle EPOLLHUP raised by epoll and also check if the recv function on socket returns zero that means socket is disconnected.
Upvotes: 1