--- old/src/java.base/unix/classes/java/net/PlainSocketImpl.java 2016-02-24 13:34:29.588280931 +0530 +++ new/src/java.base/unix/classes/java/net/PlainSocketImpl.java 2016-02-24 13:34:29.472280930 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -28,7 +28,6 @@ import java.io.FileDescriptor; import java.util.Set; import java.util.HashSet; -import java.util.Collections; import jdk.net.*; import static sun.net.ExtendedOptionsImpl.*; @@ -59,7 +58,13 @@ protected void setOption(SocketOption name, T value) throws IOException { if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) { - super.setOption(name, value); + if (!name.equals(ExtendedSocketOptions.SO_QUICKACK)) { + super.setOption(name, value); + } else if (isQuickAckAvailable()) { + setQuickAckOption(getFileDescriptor(), ((Boolean)value)); + } else { + throw new UnsupportedOperationException("unsupported option"); + } } else { if (getSocket() == null || !flowSupported()) { throw new UnsupportedOperationException("unsupported option"); @@ -76,7 +81,13 @@ @SuppressWarnings("unchecked") protected T getOption(SocketOption name) throws IOException { if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) { - return super.getOption(name); + if (!name.equals(ExtendedSocketOptions.SO_QUICKACK)) { + return super.getOption(name); + } else if (isQuickAckAvailable()) { + return (T) getQuickAckOption(getFileDescriptor()); + } else { + throw new UnsupportedOperationException("unsupported option"); + } } if (getSocket() == null || !flowSupported()) { throw new UnsupportedOperationException("unsupported option"); @@ -97,6 +108,9 @@ if (getSocket() != null && flowSupported()) { options.add(ExtendedSocketOptions.SO_FLOW_SLA); } + if (getSocket() != null && isQuickAckAvailable()) { + options.add(ExtendedSocketOptions.SO_QUICKACK); + } return options; }