For dynamic socket buffer sizing, don't trust the return value of setsockopt
In at least the Linux 3.2 kernel on Ubuntu 12, setsockopt to set the socket buffer size does not return an error if you try to set a value higher than the kernel max. So we do an immediately following getsockopt to verify. This will prevent the server from over-driving the send socket (leading to re-requests of blocks from clients) for really high bandwidth values (i.e., with large burst sizes).
Please register or sign in to comment