--- a/jdk/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java Tue Feb 23 09:49:04 2016 +0100
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java Tue Feb 23 17:41:00 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
import java.util.*;
import sun.net.NetHooks;
-
/**
* An implementation of ServerSocketChannels
*/
@@ -185,6 +184,9 @@
HashSet<SocketOption<?>> set = new HashSet<>(2);
set.add(StandardSocketOptions.SO_RCVBUF);
set.add(StandardSocketOptions.SO_REUSEADDR);
+ if (Net.isReusePortAvailable()) {
+ set.add(StandardSocketOptions.SO_REUSEPORT);
+ }
set.add(StandardSocketOptions.IP_TOS);
return Collections.unmodifiableSet(set);
}