diff --git a/src/sock.c b/src/sock.c index 4398055..39621d8 100644 --- a/src/sock.c +++ b/src/sock.c @@ -49,6 +49,8 @@ static DWORD _epoll_events_to_afd_events(uint32_t epoll_events) { afd_events |= AFD_POLL_RECEIVE_EXPEDITED; if (epoll_events & (EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND)) afd_events |= AFD_POLL_SEND | AFD_POLL_CONNECT; + if (epoll_events & (EPOLLIN | EPOLLRDNORM | EPOLLRDHUP)) + afd_events |= AFD_POLL_DISCONNECT; return afd_events; } @@ -62,8 +64,8 @@ static uint32_t _afd_events_to_epoll_events(DWORD afd_events) { epoll_events |= EPOLLPRI | EPOLLRDBAND; if (afd_events & (AFD_POLL_SEND | AFD_POLL_CONNECT)) epoll_events |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND; - if ((afd_events & AFD_POLL_DISCONNECT) && !(afd_events & AFD_POLL_ABORT)) - epoll_events |= EPOLLIN | EPOLLRDHUP; + if (afd_events & AFD_POLL_DISCONNECT) + epoll_events |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP; if (afd_events & AFD_POLL_ABORT) epoll_events |= EPOLLHUP; if (afd_events & AFD_POLL_CONNECT_FAIL)