equal
deleted
inserted
replaced
29 import java.nio.ByteBuffer; |
29 import java.nio.ByteBuffer; |
30 import java.net.*; |
30 import java.net.*; |
31 import java.util.concurrent.*; |
31 import java.util.concurrent.*; |
32 import java.io.IOException; |
32 import java.io.IOException; |
33 import java.io.FileDescriptor; |
33 import java.io.FileDescriptor; |
34 import java.security.AccessController; |
|
35 import sun.net.NetHooks; |
34 import sun.net.NetHooks; |
36 import sun.security.action.GetPropertyAction; |
35 import sun.security.action.GetPropertyAction; |
37 |
36 |
38 /** |
37 /** |
39 * Unix implementation of AsynchronousSocketChannel |
38 * Unix implementation of AsynchronousSocketChannel |
45 private static final NativeDispatcher nd = new SocketDispatcher(); |
44 private static final NativeDispatcher nd = new SocketDispatcher(); |
46 private static enum OpType { CONNECT, READ, WRITE }; |
45 private static enum OpType { CONNECT, READ, WRITE }; |
47 |
46 |
48 private static final boolean disableSynchronousRead; |
47 private static final boolean disableSynchronousRead; |
49 static { |
48 static { |
50 String propValue = AccessController.doPrivileged( |
49 String propValue = GetPropertyAction |
51 new GetPropertyAction("sun.nio.ch.disableSynchronousRead", "false")); |
50 .getProperty("sun.nio.ch.disableSynchronousRead", "false"); |
52 disableSynchronousRead = (propValue.length() == 0) ? |
51 disableSynchronousRead = (propValue.length() == 0) ? |
53 true : Boolean.valueOf(propValue); |
52 true : Boolean.valueOf(propValue); |
54 } |
53 } |
55 |
54 |
56 private final Port port; |
55 private final Port port; |