-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.2.2
-
x86
-
linux
Name: kaC94536 Date: 11/19/99
Java 2 Platform SE v1.3 specification reads:
...
public void setSendBufferSize(int size)
throws SocketException
Sets the SO_SNDBUF option to the specified value for this
DatagramSocket.
...
public int getSendBufferSize()
throws SocketException
Get value of the SO_SNDBUF option for this socket.
...
But the following test shows that getSendBufferSize() method returns
value differing from the one we set before by setSendBufferSize().
This bug can be reproduced by the following JCK test:
api/java_net/DatagramSocket/index.html#setSendBufferSize
----------------------------- test.java ------------------------
import java.net.*;
public class test {
public static void main(String argv[]) {
DatagramSocket soc = null;
int size = 0;
int m = 131071;
try {
soc = new DatagramSocket();
soc.setSendBufferSize(m);
size = soc.getSendBufferSize();
soc.close();
} catch (Throwable e) {
System.out.println("Unexpected " + e);
soc.close();
}
if (size != m)
System.out.println("Values mismatch: " + size + " != " + m);
else
System.out.println("Ok");
}
}
-------------------------------- output --------------------------
$ java -fullversion
java full version "1.2.2-D"
$ java test
Values mismatch: 131070 != 131071
$
======================================================================
======================================================================