I'm using epoll
to get notifications about incoming data. It's not hard because all events returned by epoll_wait()
indicates, that I can read data from epoll_event.data.fd
(socket descriptor).
But now I want get both types of notification: receiving and sending (socket is available for send). But I can't to do it because:
epoll_event.events
which is returned byepoll_wait()
is the same as I pass inepoll_ctl()
. So it contains bothEPOLLIN
andEPOLLOUT
in my case.- Also if i trying to twice add one socket in
epoll
(as EPOLLIN and as EPOLLOUT event) I'll get aEEXIST
.
How can I solve this problem without manually calling select()
every time I get notification?