When the send function of socket is executed, the eagain error is returned.]
Abstract:
When the customer sends large data packets through the send function provided by socket, an eggain error may be returned. This error is caused by sending
The size variable in the function exceeds the value of tcp_sendspace. Tcp_sendspace defines the amount of data that the application can cache in the kernel before calling send. If the o_ndelay or o_nonblock attribute is set in the socket, The eagain error is returned if the sending cache is full.
To eliminate this error, you can choose from the following three methods:
1. Increase tcp_sendspace so that it is greater than the size parameter in send
--- No-p-o tcp_sendspace = 65536
2. Before sending, set a greater value for sndbuf in the setsockopt function.
3. Replace send with write because write does not set o_ndelay or o_nonblock.