Re: socket: setting SO_SNDBUF

From: Ton Hospel (thospel@mail.dma.be)
Date: Fri Jul 07 2000 - 17:12:19 EST


In article <NCBBLIEPOCNJOAEKBEAKCECIJJAA.davids@webmaster.com>,
        "David Schwartz" <davids@webmaster.com> writes:
>> If you don't attach some semantics to SO_SNDBUF even if there are no
>> standards, you basically make it a completely useless call, since nobody
>> can know what value you are supposed to give.
>
> That's not the Linux's fault.

Sockets also were not standardised for the longest time. Doesn't mean you
can just make up your own semantics. Tradition also counts.

>
>> If it was a COMPLETELY meaningless number, why did you bother fudging it
>> on set ? (yes, I know, existing programs. Don't they deserve the same
>> courtesy for get ?)
>
> It was necessary to fudge it for set to preserve existing programs.

Yes, and the second part. Why not give get the same courtesy ?

>
>> So why not end this recuring thread by just fudging the get by the same
>> factor as set ? It still remains an ill-defined number, but at least
>> there will be consistency between in and out.
>
> Because right now, the value you get actually means something. There is no
> sense in deliberately returning a meaningless number.

Yes, it returns the size of some internal implementation detail, while the
fudged value would be good enough to have it roughly mean the traditional
thing, which is an order of magnitude more useful.

The best solution to mee seems to fudge get, and introduce a new sockopt
(LINUX_SNDBUF or something) for that internal buffer (though I cannot
think of any reason why I would want that internal buffer. Can you ?)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:22 EST