The short answer is this. βsendβ calls to the TCP socket will only be blocked until the TCP pivot window (or internal queue buffers) opens as a result of the remote endpoint receiving and consuming data. This is not much different from trying to write bytes to a file faster than the disk can save it.
If your socket is configured for non-blocking mode, sending will return EWOULDBLOCK or EAGAIN until data is sent. The standard poll , select and epoll will work as expected, so you know when to send again.
source share