Patch for adding SO_REUSEPORT socket option

Alan Bateman Alan.Bateman at oracle.com
Sun Nov 22 08:24:37 UTC 2015


On 21/11/2015 02:08, Lu, Yingqi wrote:
>
> Hi Alan,
>
> Please let me know if there is anything we can do at the meantime to 
> help. We are more than happy to help.
>
>
Sorry, I wasn't clear. I meant that you will need to work on the 
javadoc. In many of the classes you've added the following to the spec:

"In case of Windows and Solaris, this function  should throw 
SocketException with message "Invalid option". In case of Linux with 3.8 
and older kernel, this founction should throw SocketException with 
message "Protocol not available"."

but this is implementation specific, maybe even locale specific too.

So I think it's best to start with java.net.StandardSocketOptions and 
try to get agreement on how the socket option is specified. You should 
also get familiar with the API tags to distinguish specification and 
implementation [1]. Once there is agreement on StandardSocketOptions 
then the javadoc for the java.net set/get methods should be 
straight-forward.

For the NetworkChannels (SocketChannel, etc) then you might consider 
just dropping it from the javadoc. The reason is that these tables are 
the socket options that are supported by all implementations and this is 
not the case here. Instead you can leave to the implementation, which is 
okay because NetworkChannels allow for socket options beyond those 
listed in the tables. The other thing to be aware of is that 
setOption/getOption methods are specified to throw UOE when invoked to 
set/get a socket option that is not supported by the implementation. 
This will also help with the tests as you will be able to use the 
supportedOptions method to test if a socket option is supported, no need 
to parse exception messages.

-Alan.

[1] http://openjdk.java.net/jeps/8068562
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20151122/bc01d431/attachment.html>


More information about the net-dev mailing list