< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 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 --- 1,7 ---- /* ! * Copyright (c) 2016, 2017, 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
*** 277,286 **** --- 277,289 ---- set.add(StandardSocketOptions.IP_TOS); set.add(StandardSocketOptions.TCP_NODELAY); if (flowsupported) { set.add(ExtendedSocketOptions.SO_FLOW_SLA); } + if (QuickAck.available) { + set.add(ExtendedSocketOptions.TCP_QUICKACK); + } set = Collections.unmodifiableSet(set); options.put(Socket.class, set); // ServerSocket
*** 288,297 **** --- 291,303 ---- set.add(StandardSocketOptions.SO_RCVBUF); set.add(StandardSocketOptions.SO_REUSEADDR); if (reuseportsupported) { set.add(StandardSocketOptions.SO_REUSEPORT); } + if (QuickAck.available) { + set.add(ExtendedSocketOptions.TCP_QUICKACK); + } set.add(StandardSocketOptions.IP_TOS); set = Collections.unmodifiableSet(set); options.put(ServerSocket.class, set); // DatagramSocket
*** 329,334 **** --- 335,353 ---- set = Collections.unmodifiableSet(set); options.put(MulticastSocket.class, set); return Collections.unmodifiableMap(options); } + + /** + * Tells whether TCP_QUICKACK is supported. + */ + static class QuickAck { + + static final boolean available; + + static { + Set<SocketOption<?>> s = new Socket().supportedOptions(); + available = s.contains(ExtendedSocketOptions.TCP_QUICKACK); + } + } }
< prev index next >