--- old/src/solaris/classes/java/net/PlainSocketImpl.java Tue Apr 8 17:15:17 2014 +++ new/src/solaris/classes/java/net/PlainSocketImpl.java Tue Apr 8 17:15:16 2014 @@ -26,7 +26,13 @@ import java.io.IOException; import java.io.FileDescriptor; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import jdk.net.*; +import static sun.net.ExtendedOptionsImpl.*; + /* * On Unix systems we simply delegate to native methods. * @@ -51,6 +57,46 @@ this.fd = fd; } + protected void setOption(SocketOption name, T value) + throws IOException + { + if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) { + super.setOption(name, value); + } else { + if (isClosedOrPending()) { + throw new SocketException("Socket closed"); + } + setSecurityCheck(name); + checkValueType(value, SocketFlow.class); + setFlowOption(getFileDescriptor(), (SocketFlow)value); + } + } + + protected T getOption(SocketOption name) throws IOException + { + if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) { + return super.getOption(name); + } + if (isClosedOrPending()) { + throw new SocketException("Socket closed"); + } + getSecurityCheck(name); + SocketFlow flow = SocketFlow.create(); + getFlowOption(getFileDescriptor(), flow); + return (T)flow; + } + + protected Set> supportedOptions() + { + HashSet> options = new HashSet( + super.supportedOptions()); + + if (getSocket() != null && flowSupported()) { + options.add(ExtendedSocketOptions.SO_FLOW_SLA); + } + return options; + } + native void socketCreate(boolean isServer) throws IOException; native void socketConnect(InetAddress address, int port, int timeout) @@ -77,5 +123,4 @@ native int socketGetOption(int opt, Object iaContainerObj) throws SocketException; native void socketSendUrgentData(int data) throws IOException; - }