Home
last modified time | relevance | path

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

12

/libcore/ojluni/src/main/java/java/nio/channels/
DFileLock.java121 private final Channel channel; field in FileLock
147 protected FileLock(FileChannel channel, in FileLock() argument
156 this.channel = channel; in FileLock()
185 protected FileLock(AsynchronousFileChannel channel, in FileLock() argument
194 this.channel = channel; in FileLock()
209 public final FileChannel channel() { in channel() method in FileLock
210 return (channel instanceof FileChannel) ? (FileChannel)channel : null; in channel()
221 return channel; in acquiredBy()
/libcore/ojluni/src/main/java/sun/nio/ch/
DPendingFuture.java41 private final AsynchronousChannel channel; field in PendingFuture
59 PendingFuture(AsynchronousChannel channel, in PendingFuture() argument
64 this.channel = channel; in PendingFuture()
70 PendingFuture(AsynchronousChannel channel, in PendingFuture() argument
74 this.channel = channel; in PendingFuture()
79 PendingFuture(AsynchronousChannel channel) { in PendingFuture() argument
80 this(channel, null, null); in PendingFuture()
83 PendingFuture(AsynchronousChannel channel, Object context) { in PendingFuture() argument
84 this(channel, null, null, context); in PendingFuture()
87 AsynchronousChannel channel() { in channel() method in PendingFuture
[all …]
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()
DEPollPort.java65 final PollableChannel channel; field in EPollPort.Event
68 Event(PollableChannel channel, int events) { in Event() argument
69 this.channel = channel; in Event()
73 PollableChannel channel() { return channel; } in channel() method in EPollPort.Event
223 PollableChannel channel = fdToChannel.get(fd); in poll() local
224 if (channel != null) { in poll()
226 Event ev = new Event(channel, events); in poll()
293 ev.channel().onEvent(ev.events(), isPooledThread); in run()
DFileLockImpl.java36 FileLockImpl(FileChannel channel, long position, long size, boolean shared) in FileLockImpl() argument
38 super(channel, position, size, shared); in FileLockImpl()
41 FileLockImpl(AsynchronousFileChannel channel, long position, long size, boolean shared) in FileLockImpl() argument
43 super(channel, position, size, shared); in FileLockImpl()
DInvoker.java168 static <V,A> void invoke(AsynchronousChannel channel, in invoke() argument
178 if ((thisGroupAndInvokeCount.group() == ((Groupable)channel).group())) in invoke()
191 invokeIndirectly(channel, handler, attachment, result, exc); in invoke()
208 static <V,A> void invokeIndirectly(AsynchronousChannel channel, in invokeIndirectly() argument
215 ((Groupable)channel).group().executeOnPooledThread(new Runnable() { in invokeIndirectly()
254 static void invokeOnThreadInThreadPool(Groupable channel, in invokeOnThreadInThreadPool() argument
259 AsynchronousChannelGroupImpl targetGroup = channel.group(); in invokeOnThreadInThreadPool()
300 invoke(future.channel(), in invoke()
316 invokeIndirectly(future.channel(), in invokeIndirectly()
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()
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()
DPort.java127 final Object attachForeignChannel(final Channel channel, FileDescriptor fd) { in attachForeignChannel() argument
132 channel.close(); in attachForeignChannel()
/libcore/luni/src/test/java/libcore/java/nio/channels/
DDatagramChannelTest.java198 DatagramChannel channel = DatagramChannel.open(); in test_bind() local
199 channel.bind(socketAddress); in test_bind()
201 ((InetSocketAddress)(channel.getLocalAddress())).getAddress()); in test_bind()
202 assertTrue(((InetSocketAddress)(channel.getLocalAddress())).getPort() > 0); in test_bind()
205 channel.bind(socketAddress); in test_bind()
211 ((InetSocketAddress)(channel.getLocalAddress())).getPort()); in test_bind()
217 channel.close(); in test_bind()
220 channel.bind(socketAddress); in test_bind()
242 try (DatagramChannel channel = DatagramChannel.open(StandardProtocolFamily.INET)) { in test_open$java_net_ProtocolFamily() argument
243 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()
DMembershipKeyTest.java148 assertEquals(client, key.channel()); in test_channelWithJoinWithSource()
150 assertEquals(client, key.channel()); in test_channelWithJoinWithSource()
155 assertEquals(client, key.channel()); in test_channelWithJoinWithoutSource()
157 assertEquals(client, key.channel()); in test_channelWithJoinWithoutSource()
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()
DAsynchronousFileChannelTest.java59 AsynchronousFileChannel channel = AsynchronousFileChannel.open(newFile, in testOpen_create() local
61 assertTrue(channel.isOpen()); in testOpen_create()
62 assertEquals(0, channel.size()); in testOpen_create()
63 channel.close(); in testOpen_create()
73 AsynchronousFileChannel channel = AsynchronousFileChannel.open(newFile, in testOpen_existing() local
75 channel.close(); in testOpen_existing()
88 channel = AsynchronousFileChannel.open(newFile, StandardOpenOption.CREATE, in testOpen_existing()
90 channel.close(); in testOpen_existing()
/libcore/ojluni/src/main/java/java/io/
DFileInputStream.java72 private FileChannel channel = null; field in FileInputStream
418 if (channel != null) { in close()
419 channel.close(); in close()
464 if (channel == null) { in getChannel()
465 channel = FileChannelImpl.open(fd, path, true, false, this); in getChannel()
467 return channel; in getChannel()
DFileOutputStream.java82 private FileChannel channel; field in FileOutputStream
419 if (channel != null) { in close()
420 channel.close(); in close()
468 if (channel == null) { in getChannel()
469 channel = FileChannelImpl.open(fd, path, false, true, append, this); in getChannel()
471 return channel; in getChannel()
DRandomAccessFile.java87 private FileChannel channel = null; field in RandomAccessFile
349 if (channel == null) { in getChannel()
350 channel = FileChannelImpl.open(fd, path, true, rw, this); in getChannel()
352 return channel; in getChannel()
705 if (channel != null && channel.isOpen()) { in close()
706 channel.close(); in close()
/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()
/libcore/ojluni/src/main/java/java/util/logging/
DFileHandler.java455 FileChannel channel = null; in openFiles() local
458 while (channel == null && retries++ < 1) { in openFiles()
460 channel = FileChannel.open(lockFilePath, in openFiles()
472 channel = FileChannel.open(lockFilePath, in openFiles()
492 if (channel == null) continue; // try the next name; in openFiles()
493 lockFileChannel = channel; in openFiles()

12