I've created a socket, set it into nonblock state, got an addr by getaddrinfo, connected and then added it to the EPOLL with EPOLLIN | EPOLLOUT flags. On my next iteration of epoll_wait it got instantly triggered as EPOLLOUT but when i try to write\send data i get an EINPROGRESS(115) error. Any idea would be useful. Thanks
EDIT 0: I'm using LT epoll
EDIT 1: Question is invalid. I thought that when connection is finished it will trigger EPOLLIN as listener-socket do but it triggers EPOLLOUT. Thanks for you answers
connect
completed? – user58697write
orsend
returned -1 and an immediate check oferrno
returnedEINPROGRESS
? Can you show us the code from the call towrite
orsend
all the way to the code that detected theEINPROGRESS
condition? Are you sureerrno
wasn't just stillEINPROGRESS
from a previous call toconnect
and you checkederrno
when there was no error? – David Schwartz