Home
last modified time | relevance | path

Searched refs:SelectionKey (Results 1 – 25 of 34) sorted by relevance

12

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DSelectionKeyTest.java24 import java.nio.channels.SelectionKey;
38 SelectionKey selectionKey;
47 selectionKey = sc.register(selector, SelectionKey.OP_CONNECT); in setUp()
58 static class MockSelectionKey extends SelectionKey {
77 public SelectionKey interestOps(int operations) { in interestOps()
98 MockSelectionKey mockSelectionKey = new MockSelectionKey(SelectionKey.OP_ACCEPT); in test_attach()
116 MockSelectionKey mockSelectionKey = new MockSelectionKey(SelectionKey.OP_ACCEPT); in test_attachment()
137 assertEquals(SelectionKey.OP_CONNECT, selectionKey.interestOps()); in test_interestOps()
144 selectionKey.interestOps(SelectionKey.OP_WRITE); in test_interestOpsI()
145 assertEquals(SelectionKey.OP_WRITE, selectionKey.interestOps()); in test_interestOpsI()
[all …]
DSelectorTest.java26 import java.nio.channels.SelectionKey;
105 SelectionKey key = ssc.register(selector, SelectionKey.OP_ACCEPT); in test_keys()
107 Set<SelectionKey> keySet = selector.keys(); in test_keys()
108 Set<SelectionKey> keySet2 = selector.keys(); in test_keys()
112 SelectionKey key2 = keySet.iterator().next(); in test_keys()
118 SelectionKey key3 = sc.register(selector, SelectionKey.OP_READ); in test_keys()
152 ssc.register(selector, SelectionKey.OP_ACCEPT); in test_selectedKeys()
158 Set<SelectionKey> selectedKeys = selector.selectedKeys(); in test_selectedKeys()
159 Set<SelectionKey> selectedKeys2 = selector.selectedKeys(); in test_selectedKeys()
175 Set<SelectionKey> selectedKeys3 = selector.selectedKeys(); in test_selectedKeys()
[all …]
DUnixSelectorTest.java22 import java.nio.channels.SelectionKey;
65 SelectionKey mkey0 = server.serverChannel.register(sel0, SelectionKey.OP_ACCEPT); in testSelectorAcceptAndRead()
66 server.serverChannel.register(sel1, SelectionKey.OP_ACCEPT); in testSelectorAcceptAndRead()
79 socketChannel.register(sel2, SelectionKey.OP_WRITE); in testSelectorAcceptAndRead()
96 SelectionKey mkey3 = socketChannel2.register(sel3, SelectionKey.OP_WRITE); in testSelectUnConnectedChannel()
105 SelectionKey mkey4 = socketChannel2.register(sel4, SelectionKey.OP_CONNECT); in testSelectUnConnectedChannel()
111SelectionKey mkey5 = socketChannel2.register(sel5, SelectionKey.OP_CONNECT | SelectionKey.OP_WRITE… in testSelectUnConnectedChannel()
DSelectableChannelTest.java22 import java.nio.channels.SelectionKey;
40 msc.register(Selector.open(), SelectionKey.OP_ACCEPT); in test_register_LSelectorI()
65 public SelectionKey keyFor(Selector sel) { in keyFor()
73 public SelectionKey register(Selector sel, int ops, Object att) in register()
/libcore/ojluni/src/main/java/sun/nio/ch/
DSelectorImpl.java44 protected Set<SelectionKey> selectedKeys;
47 protected HashSet<SelectionKey> keys;
50 private Set<SelectionKey> publicKeys; // Immutable
51 private Set<SelectionKey> publicSelectedKeys; // Removal allowed, but not addition
55 keys = new HashSet<SelectionKey>(); in SelectorImpl()
56 selectedKeys = new HashSet<SelectionKey>(); in SelectorImpl()
66 public Set<SelectionKey> keys() { in keys()
72 public Set<SelectionKey> selectedKeys() { in selectedKeys()
123 protected final SelectionKey register(AbstractSelectableChannel ch, in register()
142 Set<SelectionKey> cks = cancelledKeys(); in processDeregisterQueue()
[all …]
DSelectionKeyImpl.java81 public SelectionKey interestOps(int ops) { in interestOps()
102 public SelectionKey nioInterestOps(int ops) { in nioInterestOps()
DSinkChannelImpl.java131 ((intOps & SelectionKey.OP_WRITE) != 0)) in translateReadyOps()
132 newOps |= SelectionKey.OP_WRITE; in translateReadyOps()
147 if (ops == SelectionKey.OP_WRITE) in translateAndSetInterestOps()
DSocketChannelImpl.java47 import java.nio.channels.SelectionKey;
975 ((intOps & SelectionKey.OP_READ) != 0) && in translateReadyOps()
977 newOps |= SelectionKey.OP_READ; in translateReadyOps()
980 ((intOps & SelectionKey.OP_CONNECT) != 0) && in translateReadyOps()
982 newOps |= SelectionKey.OP_CONNECT; in translateReadyOps()
987 ((intOps & SelectionKey.OP_WRITE) != 0) && in translateReadyOps()
989 newOps |= SelectionKey.OP_WRITE; in translateReadyOps()
1030 if ((ops & SelectionKey.OP_READ) != 0) in translateAndSetInterestOps()
1032 if ((ops & SelectionKey.OP_WRITE) != 0) in translateAndSetInterestOps()
1034 if ((ops & SelectionKey.OP_CONNECT) != 0) in translateAndSetInterestOps()
DSourceChannelImpl.java132 ((intOps & SelectionKey.OP_READ) != 0)) in translateReadyOps()
133 newOps |= SelectionKey.OP_READ; in translateReadyOps()
148 if (ops == SelectionKey.OP_READ) in translateAndSetInterestOps()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/spi/
DAbstractSelectableChannelTest.java24 import java.nio.channels.SelectionKey;
114 SelectionKey acceptKey = sc.register(acceptSelector1, in test_register_LSelectorILObject()
115 SelectionKey.OP_READ, null); in test_register_LSelectorILObject()
121 acceptKey = sc.register(acceptSelector2, SelectionKey.OP_READ, null); in test_register_LSelectorILObject()
147 msc.register(acceptSelector, SelectionKey.OP_READ, null); in test_register_LSelectorILObject_IllegalArgument()
161 msc.register(acceptSelector, SelectionKey.OP_READ, null); in test_register_LSelectorILObject_IllegalArgument()
183 msc.register(acceptSelector, SelectionKey.OP_READ, null); in test_register_LSelectorILObject_IllegalArgument()
197 msc.register(acceptSelector, SelectionKey.OP_READ, null); in test_register_LSelectorILObject_IllegalArgument()
214 sc.register(null, SelectionKey.OP_READ, argObj); in test_register_LSelectorILObject_IllegalArgument()
223 msc.register(acceptSelector, SelectionKey.OP_READ, null); in test_register_LSelectorILObject_IllegalArgument()
[all …]
DAbstractSelectorTest.java22 import java.nio.channels.SelectionKey;
120 SelectionKey acceptKey = ssc.register(acceptSelector, in test_register_LSelectorI()
121 SelectionKey.OP_ACCEPT); in test_register_LSelectorI()
138 ssc.register(acceptSelector, SelectionKey.OP_ACCEPT); in test_register_LSelectorI_error()
148 ssc.register(acceptSelector, SelectionKey.OP_ACCEPT); in test_register_LSelectorI_error()
155 SelectionKey acceptKey = ssc.register(acceptSelector, in test_register_LSelectorI_error()
156 SelectionKey.OP_ACCEPT); in test_register_LSelectorI_error()
DMockAbstractSelector.java20 import java.nio.channels.SelectionKey;
48 protected SelectionKey register(AbstractSelectableChannel arg0, int arg1, in register()
65 public Set<SelectionKey> keys() { in keys()
69 public Set<SelectionKey> selectedKeys() { in selectedKeys()
DAbstractSelectionKeyTest.java20 import java.nio.channels.SelectionKey;
68 public SelectionKey interestOps(int arg0) { in interestOps()
/libcore/ojluni/src/main/java/java/nio/channels/spi/
DAbstractSelectableChannel.java61 private SelectionKey[] keys = null;
95 private void addKey(SelectionKey k) { in addKey()
104 keys = new SelectionKey[3]; in addKey()
108 SelectionKey[] ks = new SelectionKey[n]; in addKey()
118 private SelectionKey findKey(Selector sel) { in findKey()
129 void removeKey(SelectionKey k) { // package-private in removeKey()
161 public final SelectionKey keyFor(Selector sel) { in keyFor()
191 public final SelectionKey register(Selector sel, int ops, in register()
202 SelectionKey k = findKey(sel); in register()
238 SelectionKey k = keys[i]; in implCloseChannel()
DAbstractSelector.java29 import java.nio.channels.SelectionKey;
88 private final Set<SelectionKey> cancelledKeys = new HashSet<SelectionKey>();
90 void cancel(SelectionKey k) { // package-private in cancel()
152 protected final Set<SelectionKey> cancelledKeys() { in cancelledKeys()
175 protected abstract SelectionKey register(AbstractSelectableChannel ch, in register()
DAbstractSelectionKey.java42 extends SelectionKey
/libcore/luni/src/test/java/libcore/java/nio/channels/
DSelectorTest.java25 import java.nio.channels.SelectionKey;
45 SelectionKey key = sc.register(selector, SelectionKey.OP_CONNECT); in testNonBlockingConnect_immediate()
47 assertEquals(SelectionKey.OP_CONNECT, key.readyOps()); in testNonBlockingConnect_immediate()
130 SelectionKey key = sc.register(selector, in test_57456()
131 SelectionKey.OP_CONNECT | SelectionKey.OP_READ | SelectionKey.OP_WRITE); in test_57456()
133 assertEquals(SelectionKey.OP_READ | SelectionKey.OP_WRITE, key.readyOps()); in test_57456()
166 sc.register(selector, SelectionKey.OP_READ | SelectionKey.OP_WRITE); in test28318596()
DOldSocketChannelTest.java30 import java.nio.channels.SelectionKey;
175 assertEquals((SelectionKey.OP_CONNECT | SelectionKey.OP_READ | in testChannelBasicStatus()
176 SelectionKey.OP_WRITE), this.channel1.validOps()); in testChannelBasicStatus()
/libcore/ojluni/src/main/java/java/nio/channels/
DSelectionKey.java110 public abstract class SelectionKey { class
115 protected SelectionKey() { } in SelectionKey() method in SelectionKey
199 public abstract SelectionKey interestOps(int ops); in interestOps()
368 private static final AtomicReferenceFieldUpdater<SelectionKey,Object>
370 SelectionKey.class, Object.class, "attachment"
DSelectableChannel.java152 public abstract SelectionKey keyFor(Selector sel); in keyFor()
219 public abstract SelectionKey register(Selector sel, int ops, Object att) in register()
277 public final SelectionKey register(Selector sel, int ops) in register()
DPipe.java83 return SelectionKey.OP_READ; in validOps()
117 return SelectionKey.OP_WRITE; in validOps()
DSelector.java259 public abstract Set<SelectionKey> keys(); in keys()
275 public abstract Set<SelectionKey> selectedKeys(); in selectedKeys()
DSocketChannel.java214 return (SelectionKey.OP_READ in validOps()
215 | SelectionKey.OP_WRITE in validOps()
216 | SelectionKey.OP_CONNECT); in validOps()
DDatagramChannel.java196 return (SelectionKey.OP_READ in validOps()
197 | SelectionKey.OP_WRITE); in validOps()
/libcore/ojluni/annotations/hiddenapi/sun/nio/ch/
DSelectorImpl.java40 public java.util.Set<java.nio.channels.SelectionKey> keys() { in keys()
44 public java.util.Set<java.nio.channels.SelectionKey> selectedKeys() { in selectedKeys()
76 protected final java.nio.channels.SelectionKey register( in register()
93 protected java.util.HashSet<java.nio.channels.SelectionKey> keys;
95 private java.util.Set<java.nio.channels.SelectionKey> publicKeys;
98 private java.util.Set<java.nio.channels.SelectionKey> publicSelectedKeys;
101 protected java.util.Set<java.nio.channels.SelectionKey> selectedKeys;

12