Advertisement

Changing the read buffer size

Started by July 01, 2006 05:27 PM
1 comment, last by Peachy keen 18 years, 7 months ago
[C++] This is going to sound like a pretty lame question likely, and i'm feeling pretty dumb for having to ask it since i've been doing network programming for about 2 and a half years now, but for the life of me, i just don't know the answer to this one... so here goes. For a socket read buffer, specifically for UDP [but it likely doesn't make any difference with protocol], using 'recv from' for many clients feeding into a single port, with a large number of clients it gets very easy to max out the buffer and cause packets to be lost. Normally I'd just use more ports :P, opening up a whole mess of them [even at times several ports for a single user for instances of high traffic], or use TCP with a bunch of seperate connections. I recall somebody mentioning once though that the buffer should be at least large enough to handle a certain span of time worth of packets at maximum load, but am having trouble figuring out how to change the buffer size [the ability to change he write buffer would also be nice, especially for TCP] on a windows machine [which is what I'm developing on, even if i actually run the server on a linux machine, which is likely, i like the visual studio IDE a whole lot, so i do my dev on this :P] For some reason i even remember knowing how to do this a long time ago, but for the life of me can't find it anywhere : /
Did you try setsockopt() with SO_RCVBUF (and SO_SNDBUF)?
Advertisement
Thanks...I'm so retarded. ... I so knew this..... i know i knew this....

uhg

I knew it was something simple and obvious that had just slipped my mind : /

[nothing rings more of stupidity than something like this]

thanks though

This topic is closed to new replies.

Advertisement