< prev index next >

src/java.base/share/classes/jdk/net/Sockets.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -251,10 +251,11 @@
         }
     }
 
     private static void initOptionSets() {
         boolean flowsupported = ExtendedOptionsImpl.flowSupported();
+        boolean quickAckSupported = ExtendedOptionsImpl.isQuickAckAvailable();
 
         // Socket
 
         Set<SocketOption<?>> set = new HashSet<>();
         set.add(StandardSocketOptions.SO_KEEPALIVE);

@@ -265,10 +266,13 @@
         set.add(StandardSocketOptions.IP_TOS);
         set.add(StandardSocketOptions.TCP_NODELAY);
         if (flowsupported) {
             set.add(ExtendedSocketOptions.SO_FLOW_SLA);
         }
+        if (quickAckSupported) {
+            set.add(ExtendedSocketOptions.SO_QUICKACK);
+        }
         set = Collections.unmodifiableSet(set);
         options.put(Socket.class, set);
 
         // ServerSocket
 

@@ -287,10 +291,13 @@
         set.add(StandardSocketOptions.SO_REUSEADDR);
         set.add(StandardSocketOptions.IP_TOS);
         if (flowsupported) {
             set.add(ExtendedSocketOptions.SO_FLOW_SLA);
         }
+        if (quickAckSupported) {
+            set.add(ExtendedSocketOptions.SO_QUICKACK);
+        }
         set = Collections.unmodifiableSet(set);
         options.put(DatagramSocket.class, set);
 
         // MulticastSocket
 

@@ -303,9 +310,12 @@
         set.add(StandardSocketOptions.IP_MULTICAST_TTL);
         set.add(StandardSocketOptions.IP_MULTICAST_LOOP);
         if (flowsupported) {
             set.add(ExtendedSocketOptions.SO_FLOW_SLA);
         }
+        if (quickAckSupported) {
+            set.add(ExtendedSocketOptions.SO_QUICKACK);
+        }
         set = Collections.unmodifiableSet(set);
         options.put(MulticastSocket.class, set);
     }
 }
< prev index next >