Home
last modified time | relevance | path

Searched refs:channel (Results 1 – 25 of 30) sorted by relevance

12

/libcore/ojluni/src/main/java/java/nio/channels/
DFileLock.java118 private final Channel channel; field in FileLock
144 protected FileLock(FileChannel channel, in FileLock() argument
153 this.channel = channel; in FileLock()
168 public final FileChannel channel() { in channel() method in FileLock
169 return (channel instanceof FileChannel) ? (FileChannel)channel : null; in channel()
180 return channel; in acquiredBy()
DSelectionKey.java126 public abstract SelectableChannel channel(); in channel() method in SelectionKey
/libcore/ojluni/src/main/java/sun/nio/ch/
DSelectionKeyImpl.java41 final SelChImpl channel; // package-private field in SelectionKeyImpl
51 channel = ch; in SelectionKeyImpl()
55 public SelectableChannel channel() { in channel() method in SelectionKeyImpl
56 return (SelectableChannel)channel; in channel()
103 if ((ops & ~channel().validOps()) != 0) in nioInterestOps()
105 channel.translateAndSetInterestOps(ops, this); in nioInterestOps()
DDevPollSelectorImpl.java116 if (ski.channel.translateAndSetReadyOps(rOps, ski)) { in updateSelectedKeys()
120 ski.channel.translateAndSetReadyOps(rOps, ski); in updateSelectedKeys()
153 SelectableChannel selch = ski.channel(); in implClose()
163 int fd = IOUtil.fdVal(ski.channel.getFD()); in implRegister()
171 int fd = ski.channel.getFDVal(); in implDereg()
178 SelectableChannel selch = ski.channel(); in implDereg()
186 int fd = IOUtil.fdVal(sk.channel.getFD()); in putEventOps()
DEPollSelectorImpl.java111 if (ski.channel.translateAndSetReadyOps(rOps, ski)) { in updateSelectedKeys()
115 ski.channel.translateAndSetReadyOps(rOps, ski); in updateSelectedKeys()
148 SelectableChannel selch = ski.channel(); in implClose()
161 SelChImpl ch = ski.channel; in implRegister()
170 SelChImpl ch = ski.channel; in implDereg()
178 SelectableChannel selch = ski.channel(); in implDereg()
186 SelChImpl ch = ski.channel; in putEventOps()
DFileLockTable.java43 public static FileLockTable newSharedFileLockTable(Channel channel, in newSharedFileLockTable() argument
47 return new SharedFileLockTable(channel, fd); in newSharedFileLockTable()
113 private final Channel channel; field in SharedFileLockTable
118 SharedFileLockTable(Channel channel, FileDescriptor fd) throws IOException { in SharedFileLockTable() argument
119 this.channel = channel; in SharedFileLockTable()
187 assert (lock != null) && (lock.acquiredBy() == channel); in remove()
209 if (lock != null && lock.acquiredBy() == channel) { in removeAll()
DInheritedChannel.java201 private static Channel channel = null; field in InheritedChannel
214 channel = createChannel(); in getChannel()
220 if (channel != null) { in getChannel()
221 checkAccess(channel); in getChannel()
223 return channel; in getChannel()
DAbstractPollSelectorImpl.java96 SelectableChannel selch = channelArray[i].channel(); in implClose()
125 if (sk.channel.translateAndSetReadyOps(rOps, sk)) { in updateSelectedKeys()
129 sk.channel.translateAndSetReadyOps(rOps, sk); in updateSelectedKeys()
159 pollWrapper.addEntry(ski.channel); in implRegister()
192 SelectableChannel selch = ski.channel(); in implDereg()
DFileLockImpl.java36 FileLockImpl(FileChannel channel, long position, long size, boolean shared) in FileLockImpl() argument
38 super(channel, position, size, shared); in FileLockImpl()
/libcore/ojluni/src/main/java/java/io/
DFileInputStream.java63 private FileChannel channel = null; field in FileInputStream
350 if (channel != null) { in close()
356 channel.close(); in close()
397 if (channel == null) { in getChannel()
398 channel = FileChannelImpl.open(fd, path, true, false, this); in getChannel()
401 return channel; in getChannel()
DFileOutputStream.java78 private FileChannel channel; field in FileOutputStream
346 if (channel != null) { in close()
352 channel.close(); in close()
395 if (channel == null) { in getChannel()
396 channel = FileChannelImpl.open(fd, path, false, true, append, this); in getChannel()
398 return channel; in getChannel()
DRandomAccessFile.java74 private FileChannel channel = null; field in RandomAccessFile
291 if (channel == null) { in getChannel()
292 channel = FileChannelImpl.open(fd, path, true, rw, this); in getChannel()
294 return channel; in getChannel()
628 if (channel != null && channel.isOpen()) { in close()
629 channel.close(); in close()
/libcore/luni/src/test/java/libcore/java/nio/channels/
DDatagramChannelTest.java189 DatagramChannel channel = DatagramChannel.open(); in test_bind() local
190 channel.bind(socketAddress); in test_bind()
192 ((InetSocketAddress)(channel.getLocalAddress())).getAddress()); in test_bind()
193 assertTrue(((InetSocketAddress)(channel.getLocalAddress())).getPort() > 0); in test_bind()
196 channel.bind(socketAddress); in test_bind()
202 ((InetSocketAddress)(channel.getLocalAddress())).getPort()); in test_bind()
208 channel.close(); in test_bind()
211 channel.bind(socketAddress); in test_bind()
231 DatagramChannel channel = DatagramChannel.open(StandardProtocolFamily.INET); in test_open$java_net_ProtocolFamily() local
233 channel.bind(new InetSocketAddress(Inet4Address.LOOPBACK, 0)); in test_open$java_net_ProtocolFamily()
[all …]
DOldServerSocketChannelTest.java66 ServerSocketChannel channel = in testConstructor() local
68 assertNotNull(channel); in testConstructor()
69 assertSame(SelectorProvider.provider(),channel.provider()); in testConstructor()
DFileIOInterruptTest.java538 private final FileChannel channel; field in FileIOInterruptTest.ChannelReader
544 ChannelReader(FileChannel channel, Method method) { in ChannelReader() argument
545 this.channel = channel; in ChannelReader()
555 channel.read(buffer); in run()
558 channel.read(new ByteBuffer[] { buffer, buffer2 }); in run()
583 private final FileChannel channel; field in FileIOInterruptTest.ChannelWriter
589 ChannelWriter(FileChannel channel, Method method) { in ChannelWriter() argument
590 this.channel = channel; in ChannelWriter()
606 bytesWritten += channel.write(buffer1); in run()
608 bytesWritten += channel.write(new ByteBuffer[]{ buffer1, buffer2 }); in run()
DOldSocketChannelTest.java92 SocketChannel channel = in testConstructor() local
94 assertNotNull(channel); in testConstructor()
95 assertSame(SelectorProvider.provider(), channel.provider()); in testConstructor()
96 channel = SocketChannel.open(); in testConstructor()
97 assertNotNull(channel); in testConstructor()
98 assertSame(SelectorProvider.provider(), channel.provider()); in testConstructor()
DOldFileChannelTest.java503 private void doTestForIOOBException(FileChannel channel, in doTestForIOOBException() argument
506 channel.read(buffer, -1, 0); in doTestForIOOBException()
512 channel.read(buffer, 0, -1); in doTestForIOOBException()
518 channel.read(buffer, 0, 3); in doTestForIOOBException()
524 channel.read(buffer, 1, 2); in doTestForIOOBException()
530 channel.read(buffer, 2, 1); in doTestForIOOBException()
536 channel.read(buffer, 3, 0); in doTestForIOOBException()
645 FileChannel channel = out.getChannel(); in test_isOpen() local
647 assertTrue("Assert 0: Channel is not open", channel.isOpen()); in test_isOpen()
649 assertFalse("Assert 0: Channel is still open", channel.isOpen()); in test_isOpen()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DFileLockTest.java42 protected MockFileLock(FileChannel channel, long position, long size, in MockFileLock() argument
44 super(channel, position, size, shared); in MockFileLock()
77 assertNull(fileLock1.channel()); in test_Constructor_Ljava_nio_channels_FileChannelJJZ()
104 assertSame(readWriteChannel, mockLock.channel()); in test_channel()
106 assertNull(lock.channel()); in test_channel()
DSelectionKeyTest.java69 public SelectableChannel channel() { in channel() method in SelectionKeyTest.MockSelectionKey
127 assertSame(sc, selectionKey.channel()); in test_channel()
130 assertSame(sc, selectionKey.channel()); in test_channel()
DSelectorTest.java440 SocketChannel channel = null;
442 channel = SocketChannel.open();
443 channel.configureBlocking(false);
445 channel.register(selector, SelectionKey.OP_CONNECT);
446 channel.connect(localAddress);
447 channel.finishConnect();
451 channel.close();
/libcore/luni/src/test/java/libcore/java/io/
DInterruptedStreamTest.java142 private void testInterruptReadableChannel(final ReadableByteChannel channel) throws Exception { in testInterruptReadableChannel() argument
145 channel.read(ByteBuffer.allocate(BUFFER_SIZE)); in testInterruptReadableChannel()
179 private void testInterruptWritableChannel(final WritableByteChannel channel) throws Exception { in testInterruptWritableChannel() argument
184 channel.write(ByteBuffer.allocate(BUFFER_SIZE)); in testInterruptWritableChannel()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/spi/
DAbstractSelectableChannelTest.java118 assertSame(sc, acceptKey.channel()); in test_register_LSelectorILObject()
126 SocketChannel channel = SocketChannel.open(); in test_register_LSelectorILObject() local
127 channel.configureBlocking(false); in test_register_LSelectorILObject()
129 channel.register(selector, 0); in test_register_LSelectorILObject()
131 channel.close(); in test_register_LSelectorILObject()
DAbstractSelectionKeyTest.java56 public SelectableChannel channel() { in channel() method in AbstractSelectionKeyTest.MockSelectionKey
/libcore/luni/src/test/java/libcore/java/net/
DOldSocketTest.java1087 SocketChannel channel = SocketChannel.open(); in test_connectLjava_net_SocketAddress() local
1088 channel.configureBlocking(false); in test_connectLjava_net_SocketAddress()
1089 Socket socket = channel.socket(); in test_connectLjava_net_SocketAddress()
1392 SocketChannel channel = SocketChannel.open(); in test_connectLjava_net_SocketAddressI() local
1393 channel.configureBlocking(false); in test_connectLjava_net_SocketAddressI()
1394 Socket socket = channel.socket(); in test_connectLjava_net_SocketAddressI()
1400 channel.close(); in test_connectLjava_net_SocketAddressI()
1693 SocketChannel channel = SocketChannel.open(); in test_getChannel() local
1694 Socket socket = channel.socket(); in test_getChannel()
1695 assertEquals(channel, socket.getChannel()); in test_getChannel()
[all …]
/libcore/ojluni/src/main/java/java/nio/channels/spi/
DAbstractSelector.java185 ((AbstractSelectableChannel)key.channel()).removeKey(key); in deregister()

12