Patch for adding SO_REUSEPORT socket option
Alan Bateman
Alan.Bateman at oracle.com
Mon Nov 23 08:00:15 UTC 2015
On 23/11/2015 04:12, Lu, Yingqi wrote:
>
> Hi Alan,
>
> One more question please JI want to make sure I understand correctly
> on your following suggestion. In order to use supportedOptions method
> to test SO_REUSEPORT, I will need to first write a native function to
> check if SO_REUSEPORT is supported. Then, in the defaultOptions
> method, I do a conditional add for StandardSocketOptions.SO_REUSEPORT
> if it is supported on the platform? Is this a preferred way to
> implement? Please let me know!
>
>
Yes as supportedOptions() shouldn't return SO_REUSEPORT in the set when
it's not supported. It might be simplest to put that code in
sun.nio.ch.Net, maybe isReusePortSupported or some such method. In the
implementation (Net.c) then you can return true or false depending on
the platform and maybe kernel version.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20151123/6552e807/attachment.html>
More information about the net-dev
mailing list