I have a non-blocking socket to send data to. When sending data to a socket in non-blocking mode, we can get EAGAIN or EWOULDBLOCK if there is not enough space in the socket buffer. If the send call returns EAGAIN or EWOULDBLOCK, I subscribe to the EPOLLOUT event in epoll to know when the socket is ready to resend data in future.
However, in practice, I have never been in a situation where send would return EAGAIN or EWOULDBLOCK and i am not get EPOLLOUT event from epoll. For this reason, I can't test code that resend data when the EPOLLOUT event is received. How i can test my code in this case?