sreepurna

New Member
Joined
Mar 14, 2017
Messages
1
In the socket programming, SO_SNDBUF and SO_RCVBUF will have the default value as the 8192 bytes when the size of RAM is greater than 19MB.

Now, I want to change the socket buffer sizes for my sockets SO_SNDBUF, SO_RCVBUF. I know that one way is by setsockopt. But, I want to apply changes to the system default, and be able to use the modified value of the socket buffers for all the sockets I create in the system. Please let me know where do I make the configuration change?
 

Neemobeer

Windows Forum Team
Staff member
Joined
Jul 4, 2015
Messages
8,998
You set the socket buffer size with setsockopt. The SO means socket options and these buffers are per socket created.
Example: res = setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &sendbuff, sizeof(sendbuff));

Sample code found here Understanding set/getsockopt SO_SNDBUF
 

Solution