--- old/src/share/classes/sun/nio/ch/Net.java Tue Apr 8 17:15:14 2014 +++ new/src/share/classes/sun/nio/ch/Net.java Tue Apr 8 17:15:14 2014 @@ -27,11 +27,13 @@ import java.io.*; import java.net.*; +import jdk.net.*; import java.nio.channels.*; import java.util.*; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; +import sun.net.ExtendedOptionsImpl; public class Net { @@ -297,6 +299,16 @@ // only simple values supported by this method Class type = name.type(); + + if (type == SocketFlow.class) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new NetworkPermission("setOption.SO_FLOW_SLA")); + } + ExtendedOptionsImpl.setFlowOption(fd, (SocketFlow)value); + return; + } + if (type != Integer.class && type != Boolean.class) throw new AssertionError("Should not reach here"); @@ -337,7 +349,7 @@ } else { boolean b = ((Boolean)value).booleanValue(); arg = (b) ? 1 : 0; - } + } boolean mayNeedConversion = (family == UNSPEC); setIntOption0(fd, mayNeedConversion, key.level(), key.name(), arg); @@ -349,6 +361,16 @@ { Class type = name.type(); + if (type == SocketFlow.class) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new NetworkPermission("getOption.SO_FLOW_SLA")); + } + SocketFlow flow = SocketFlow.create(); + ExtendedOptionsImpl.getFlowOption(fd, flow); + return flow; + } + // only simple values supported by this method if (type != Integer.class && type != Boolean.class) throw new AssertionError("Should not reach here");