If TCP socket is set to non-blocking mode and a socket send buffer is set initially,
then send is used in a loop to send all the data. If send fails due to EAGAIN error, can the send-socket buffer be increased?
I am using Linux OS. I wanted to understand whether resizing of sendbuffer size is allowed or not. On tcp man page, “On individual connections, the socket buffer size must be set prior to the listen(2) or connect(2) calls in order to have it take effect.” Thats why the question arised
If TCP socket is set to non-blocking mode and a socket send buffer is
Share
That would be an implementation detail of the in-kernel network stack, i.e. of the operating system you run on (which you don’t state). I believe you can do this on most modern OS-es since it’s just a number limiting memory dedicated to a given socket, but it’s an entirely wrong way of approaching the problem because:
Figure out your traffic burst memory requirements, pre-set socket send buffer sizes, buffer on the application side.