tcp send window size discrepency
On our dev machine, kernel.osrelease = 2.4.21-32.0.1.EL.msdwhugemem, when I do:
cat /proc/sys/net/ipv4/tcp_wmem
I get
4096 16384 131072
But, programatically I'm geting a different result. In a program, I do:
Before issuing connect(2) I do a getsockopt; this tells me the default value. Then I do a setsockopt of the send buffer to a very large value (8*1024*1024). The call succeeds. Then I do another getsockopt to see what the actual value is. I get 262,142. Since I did not get 8MB (got less) on the second getsockopt, and since all these calls succeeded, I surmised that This must be the (current) max setting allowed on this host.
However, the current max for this host from the /proc is 131072.
Anyone know why from a program I'm getting 262142 = 131072*2 - 2 ?
Which value will the kernel use as the send buffer size? 131072 or 262142 ?
Thanks.
|