31 import java.net.SocketAddress; |
31 import java.net.SocketAddress; |
32 import java.nio.channels.AlreadyBoundException; |
32 import java.nio.channels.AlreadyBoundException; |
33 import java.util.Set; |
33 import java.util.Set; |
34 import java.util.HashSet; |
34 import java.util.HashSet; |
35 import java.security.AccessController; |
35 import java.security.AccessController; |
36 import sun.security.action.GetPropertyAction; |
36 import java.security.PrivilegedAction; |
37 import sun.nio.ch.IOUtil; |
37 import sun.nio.ch.IOUtil; |
38 import sun.nio.ch.Net; |
38 import sun.nio.ch.Net; |
39 import com.sun.nio.sctp.SctpSocketOption; |
39 import com.sun.nio.sctp.SctpSocketOption; |
40 import static com.sun.nio.sctp.SctpStandardSocketOptions.*; |
40 import static com.sun.nio.sctp.SctpStandardSocketOptions.*; |
41 |
41 |
42 public class SctpNet { |
42 public class SctpNet { |
43 static final String osName = AccessController.doPrivileged( |
43 private static final String osName = AccessController.doPrivileged( |
44 new GetPropertyAction("os.name")); |
44 (PrivilegedAction<String>) () -> System.getProperty("os.name")); |
45 |
45 |
46 /* -- Miscellaneous SCTP utilities -- */ |
46 /* -- Miscellaneous SCTP utilities -- */ |
47 |
47 |
48 private static boolean IPv4MappedAddresses() { |
48 private static boolean IPv4MappedAddresses() { |
49 if ("SunOS".equals(osName)) { |
49 if ("SunOS".equals(osName)) { |