Link to home
Start Free TrialLog in
Avatar of jtrades
jtrades

asked on

Determining the Total Network Buffer Space Available for TCP/UDP Sockets

I have a program that has multiple TCP and UDP socket connections.  In my program, I set the send and receive buffer size for the TCP sockets and the receive buffer size for the UDP sockets using setsockopt.  However, I was wondering the following::

* How can I determine how much total network buffer space is available at program startup, so that I can determine how to divide it up between my various sockets?  Right now, I use getsockopt to see what the send or receive buffer size is set for an individual socket, but it would be nice to see the total available before creating any sockets.

* Where is the network buffer space physically located?

I am programming in C/C++ using MS Visual C++ 2010 Express on a windows 7 machine.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jtrades
jtrades

ASKER

Thanks for the info.  However, do you know of any functions that I can call within my program to find the current total network buffer size (not just on a per socket basis)?  I want to be able to adjust the size depending on how many connections I create.  
Well, as that article states, you can find them as

    *      The per-interface TcpWindowSize registry value.
    *      The GlobalMaxTcpWindowSize registry value.

So, you basically just have to read these registry values.
Avatar of jtrades

ASKER

Looks like these values don't exist every time.  In some articles, the admin/user may have to add these registry values to tweak their tcp performance.  Can you think of any other values that I can obtain within my program that are more consistent?
Avatar of jtrades

ASKER

One more related question.  What is the max SO_RCVBUF/SO_SNDBUF that I can set?  From what I read, it seems to be 256K, but using setsockopt  I was able to maintain buffer sizes in the MB range.  Is this possible?
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.