Some 1.2 methods for DatagramSocket from Classpath

Bryce McKinlay bryce@waitaki.otago.ac.nz
Sat Jan 12 18:02:00 GMT 2002


On Sunday, January 13, 2002, at 09:24  AM, Mark Wielaard wrote:

> Since natPlainDatagramSocket.cc already had support for
> SO_RCVBUF/SO_SNDBUF I added the corresponding 1.2 methods from Classpath
> to DatagramSocket. The rest of the class has not yet been merged.
>
> 2002-01-12  Mark Wielaard  <mark@klomp.org>
>
>   * java/net/DatagramSocket.java (getReceiveBufferSize): new 1.2 method.
>   * java/net/DatagramSocket.java (getSendBufferSize): Likewise.
>   * java/net/DatagramSocket.java (setReceiveBufferSize): Likewise.
>   * java/net/DatagramSocket.java (setSendBufferSize): Likewise.
>
> OK to commit?

OK.

> P.S. Funny thing that I noticed is that on Linux kernels the value
> setsockopt is always multiplied with two. I looked in the source and it
> just does a val*2 on a set, but dow not divide by 2 on a getsockopt.
> Strange.

IIRC, the socket options are just hints, so its legal for the kernel to 
ignore or adjust them as it sees fit. The kernel engineers probably did 
this to perform better on some benchmark ;-)

thanks,

Bryce.




More information about the Java-patches mailing list