[sctp-dev] Socket Options Issue
Bruce Buffam
bbuffam at rim.com
Thu Jan 14 06:17:56 PST 2010
Hi Chris,
I am currently working on integrating the use of SCTP channels into
Netty, an Open Source networking framework and I encountered an odd
behaviour in setting/getting SO_RCVBUF or SO_SNDBUF. Typically, I have
some test code that sets one or both of these options and then
immediately tries to retrieve the value. If the retrieved value does
not match the value that was set, the test code throws an exception.
Here is some example code:
@SuppressWarnings("restriction")
public void setReceiveBufferSize(int receiveBufferSize) {
// TODO Auto-generated method stub
try {
channel.setOption(SctpStandardSocketOption.SO_RCVBUF,
receiveBufferSize);
int temp =
channel.getOption(SctpStandardSocketOption.SO_RCVBUF);
if (temp != receiveBufferSize)
throw new IOException("SO_RCVBUF not correctly
set");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
My test case uses odd values like 9753, etc. What I noticed, is that
when I do the get, it consistently retrieves the value I set, multiplied
by 2.
Any thoughts on a possible cause?
BTW, the problem is found in:
fedora fc11
linux 2.6.30.9-102.fc11.i586
java java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b78)
Java HotSpot(TM) Server VM (build 17.0-b05, mixed mode)
Rgds,
Bruce
Bruce Buffam
Blackberry System Architecture
Research in Motion
tel: +1-613-599-7465 x13036
mobile:+1-613-240-7769
fax: +1-613-599-1922
---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/sctp-dev/attachments/20100114/694ab131/attachment-0001.html
More information about the sctp-dev
mailing list