--- a/jdk/src/share/classes/sun/nio/ch/Net.java Wed Jul 05 19:36:17 2017 +0200
+++ b/jdk/src/share/classes/sun/nio/ch/Net.java Sat Apr 12 20:21:09 2014 +0100
@@ -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");
@@ -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");