Re: setsockopt
- From: "Nikolaos D. Bougalis" <nikb@xxxxxxxxxxxxx>
- Date: Wed, 12 Sep 2007 02:18:34 -0700
Jack wrote:
LINE1 gets the default UDP buffer size. LINE2 sets a new value. LINE3
gets the new UDP buffer size. When running the code on Linux system,
why the output at LINE3 is double the value at LINE2? For example, if
udpbuf0 is 11000, the output of LINE3 is 22000.
The system doubles the buffer on purpose: half of it is reserved for internal socket metadata, a behavior that is different from the Berkeley, so the system doubles the buffer to ensure you get what you, most likely, meant. Take a look at "man 7 socket"
-n
.
- References:
- setsockopt
- From: Jack
- setsockopt
- Prev by Date: Kernel Compilation - Kernel Panic - Not Synching: VFS: unable to mount root fs on unkown-block(0,0)
- Next by Date: Re: writing drivers using C++
- Previous by thread: setsockopt
- Next by thread: Re: setsockopt
- Index(es):