Using setsockopt:
Here are instructions on how to use setsockopt to set TCP buffer
sizes within your application:
setsockopt() | Sample Usage: int skt, int sndsize; err = setsockopt(skt, SOL_SOCKET, SO_SNDBUF, (char *)&sndsize, (int)sizeof(sndsize)); or: |
getsockopt() | Sample Usage: (use this to see what socket is currently set
to) int sockbufsize = 0; |
Note: its a good idea to always call getsockopt after setting
the buffer size, to make sure that the OS supports buffers of that size. The best place to
check it is after the server listen or client connect. Some OS's seem to modify the TCP
window size to their max or default at that time.