Firstly, I know that we can use setsockopt()
to control SNDBUF (I know it is not recommended but I want to know how it works and how bad it is), and this will fix the buffer size to a value we want (The size I set is rightly between the limitaion of net.ipv4.tcp_wmem
so that they work well). I try some different sizes to see the relationship between the SNDBUF and send queue which we can get from netstat
.
I expect that if we set a larger SNDBUF size, we may get a larger send queue from netstat
. But it doesn't work like I expect : this will cause lots of EAGAIN/EWOULDBLOCK error.
So I wonder if there is any connection between the send queue size and the error EAGAIN/EWOULDBLOCK, if a long queue size cause the error then everything can be explained. I trace the Linux kerenel source code but I haven't find anything useful. Can you gives some useful guide like how it works and which function realise it, thanks for any help.