| Modifier and Type | Field and Description |
|---|---|
| private final FileDescriptor | |
| private final int | |
| private volatile boolean | |
| private static final NativeDispatcher | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private final Object | |
| private final ReentrantLock | |
| private Thread |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | configureSocketNonBlockingIfVirtualThread()
Ensures that the socket is configured non-blocking when on a virtual thread. |
| private void | endWrite(boolean blocking, boolean completed)
Marks the end of a write operation that may have blocked. |
| private void | |
| public FileDescriptor | |
| public int | |
| private void | |
| private void | |
| protected void | implCloseSelectableChannel()
Implements abstract java. Invoked by implCloseChannel to close the channel. |
| protected void | implConfigureBlocking(boolean block)
Implements abstract java. Adjusts this channel's blocking mode. |
| public void | |
| public boolean | translateAndSetReadyOps(int ops, SelectionKeyImpl ski)
Implements sun. Sets the specified ops if present in interestOps. |
| public boolean | translateAndUpdateReadyOps(int ops, SelectionKeyImpl ski)
Implements sun. Adds the specified ops if present in interestOps. |
| public int | translateInterestOps(int ops)
Implements sun. Translates an interest operation set into a native event set |
| public boolean | |
| private boolean | tryClose()
Closes the write end of the pipe if there are no write operation in progress and the channel is not registered with a Selector. |
| private void | |
| public int | write(ByteBuffer src)
Implements java. Writes a sequence of bytes to this channel from the given buffer. |
| public long | write(ByteBuffer[] srcs, int offset, int length)
Implements java. Writes a sequence of bytes to this channel from a subsequence of the given buffers. |
| public long | write(ByteBuffer[] srcs)
Implements java. Writes a sequence of bytes to this channel from the given buffers. |
| fd | back to summary |
|---|---|
| private final FileDescriptor fd | |
| fdVal | back to summary |
|---|---|
| private final int fdVal | |
| forcedNonBlocking | back to summary |
|---|---|
| private volatile boolean forcedNonBlocking | |
| nd | back to summary |
|---|---|
| private static final NativeDispatcher nd | |
| ST_CLOSED | back to summary |
|---|---|
| private static final int ST_CLOSED | |
| ST_CLOSING | back to summary |
|---|---|
| private static final int ST_CLOSING | |
| ST_INUSE | back to summary |
|---|---|
| private static final int ST_INUSE | |
| state | back to summary |
|---|---|
| private int state | |
| stateLock | back to summary |
|---|---|
| private final Object stateLock | |
| writeLock | back to summary |
|---|---|
| private final ReentrantLock writeLock | |
| writerThread | back to summary |
|---|---|
| private Thread writerThread | |
| SinkChannelImpl | back to summary |
|---|---|
| pack-priv SinkChannelImpl(SelectorProvider sp, FileDescriptor fd) throws IOException | |
| beginWrite | back to summary |
|---|---|
| private void beginWrite(boolean blocking) throws ClosedChannelException Marks the beginning of a write operation that might block.
| |
| configureSocketNonBlockingIfVirtualThread | back to summary |
|---|---|
| private void configureSocketNonBlockingIfVirtualThread() throws IOException Ensures that the socket is configured non-blocking when on a virtual thread. | |
| endWrite | back to summary |
|---|---|
| private void endWrite(boolean blocking, boolean completed) throws AsynchronousCloseException Marks the end of a write operation that may have blocked.
| |
| ensureOpen | back to summary |
|---|---|
| private void ensureOpen() throws ClosedChannelException Checks that the channel is open.
| |
| getFD | back to summary |
|---|---|
| public FileDescriptor getFD() Implements sun. | |
| getFDVal | back to summary |
|---|---|
| public int getFDVal() Implements sun. | |
| implCloseBlockingMode | back to summary |
|---|---|
| private void implCloseBlockingMode() throws IOException Closes this channel when configured in blocking mode. If there is a write operation in progress then the write-end of the pipe is pre-closed and the writer is signalled, in which case the final close is deferred until the writer aborts. | |
| implCloseNonBlockingMode | back to summary |
|---|---|
| private void implCloseNonBlockingMode() throws IOException Closes this channel when configured in non-blocking mode. If the channel is registered with a Selector then the close is deferred until the channel is flushed from all Selectors. | |
| implCloseSelectableChannel | back to summary |
|---|---|
| protected void implCloseSelectableChannel() throws IOException Implements abstract java. Invoked by implCloseChannel to close the channel.
| |
| implConfigureBlocking | back to summary |
|---|---|
| protected void implConfigureBlocking(boolean block) throws IOException Implements abstract java. Doc from java. Adjusts this channel's blocking mode. This method is invoked by the
| |
| kill | back to summary |
|---|---|
| public void kill() Implements sun.
| |
| translateAndSetReadyOps | back to summary |
|---|---|
| public boolean translateAndSetReadyOps(int ops, SelectionKeyImpl ski) Implements sun. Doc from sun. Sets the specified ops if present in interestOps. The specified ops are turned on, and all other ops are turned off. | |
| translateAndUpdateReadyOps | back to summary |
|---|---|
| public boolean translateAndUpdateReadyOps(int ops, SelectionKeyImpl ski) Implements sun. Doc from sun. Adds the specified ops if present in interestOps. The specified ops are turned on without affecting the other ops. | |
| translateInterestOps | back to summary |
|---|---|
| public int translateInterestOps(int ops) Implements sun. Doc from sun. Translates an interest operation set into a native event set | |
| translateReadyOps | back to summary |
|---|---|
| public boolean translateReadyOps(int ops, int initialOps, SelectionKeyImpl ski) | |
| tryClose | back to summary |
|---|---|
| private boolean tryClose() throws IOException Closes the write end of the pipe if there are no write operation in progress and the channel is not registered with a Selector. | |
| tryFinishClose | back to summary |
|---|---|
| private void tryFinishClose() Invokes tryClose to attempt to close the write end of the pipe. This method is used for deferred closing by I/O and Selector operations. | |
| write | back to summary |
|---|---|
| public int write(ByteBuffer src) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffer. An attempt is made to write up to r bytes to the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is written, where
For many types of channels, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. The write method may need to be invoked more than once to ensure that all remaining bytes are written. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| write | back to summary |
|---|---|
| public long write(ByteBuffer[] srcs, int offset, int length) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from a subsequence of the given buffers. An attempt is made to write up to r bytes to this channel, where r is the total number of bytes remaining in the specified subsequence of the given buffer array, that is, srcs[offset].remaining() + srcs[offset+1].remaining() + ... + srcs[offset+length-1].remaining() Suppose that a byte sequence of length n is written, where
For many types of channels, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. The write method may need to be invoked more than once to ensure that all remaining bytes are written. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| write | back to summary |
|---|---|
| public long write(ByteBuffer[] srcs) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffers. An invocation of this method of the form c.write(srcs, 0, srcs.length);
| |