If you wait for EPOLLOUT
, you are guaranteed that the next send
will not block. That means it will accept at least 1 byte (this is admittedly a quite poor guaranteee, but unluckily it's just that, you're never guaranteed that send
accepts more than at least 1 byte).
You can do perfectly well without waiting for EPOLLOUT
if either blocking is no issue or if the socket is nonblocking (in which case send
would fail with EWOULDBLOCK
). It sure results in much less complicated code.
It's not wrong to do either.