RFR:8194298 Add support for per Socket configuration of TCP keepalive

Alan Bateman Alan.Bateman at oracle.com
Fri May 11 08:04:54 UTC 2018


On 10/05/2018 16:21, vyom tewari wrote:
> Hi,
>
> Please find the latest 
> webrev(http://cr.openjdk.java.net/~vtewari/8194298/webrev0.2/index.html). 
> I incorporated most of the review comments. Chris as you suggested in 
> below mail i did not added the note for upper-bound because values are 
> also OS specific.
This looks much better.

As I also mentioned previously, it would be a lot cleaner to register by 
socket type rather than filter by socket option name but since it's now 
hidden in ExtendedSocketOptions then it's probably okay (and can be 
improved at a later time). For consistency, options(SOCK_STREAM) should 
filter "UDP_*" sockets and the method can throw IAE to reject unknown 
socket types.

It would be better if the channel implementation didn't static import 
ExtendedSocketOptions.getInstance as that is a very generic method 
method name. As I mentioned previously, you could simplify all these 
usages if you add the following to sun.net.ext.ExtendedSocketOption
    static Set<SocketOption<?>> options(int type) { return 
getInstance().options(type)); }

A minor comment on tests is that they can use List.of instead of 
Arrays.asList.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20180511/a66c769e/attachment.html>


More information about the net-dev mailing list