Channel implementations which use a Selector based approach.
| Modifier and Type | Field and Description |
|---|---|
| private final SelectableChannel | |
| private static final InternalLogger | |
| private final NioProcessor | |
| private final int | |
| private volatile SelectionKey |
| Access | Constructor and Description |
|---|---|
| protected | AbstractNioChannel(P
the parent parent, EventLoop Channel by which this instance was created.
May be nullthe eventLoop, boolean EventLoop to use for all I/O.true if and only if the channel has the disconnect()
operation that allows a user to disconnect and then call {the default defaultReadHandleFactory, WriteHandleFactory ReadHandleFactory to use.the defaultWriteHandleFactory, SelectableChannel WriteHandleFactory that is used by default.the underlying ch, int SelectableChannel on which it operatesthe ops to set to receive data from the readInterestOp)SelectableChannelCreate a new instance |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| protected final void | doClearScheduledRead()
Overrides io. |
| protected final void | |
| protected final void | doRead(boolean
true if a read was already pending when read()
was called.Implements abstract io. |
| private void | |
| private static BufferAllocator | |
| public final boolean | isOpen()
Implements io. true if the Channel is open and may get active later
|
| protected final boolean | isWriteFlushedScheduled()
Overrides io. true if flushed messages should not be tried to write when calling flush().
|
| protected SelectableChannel | |
| protected final Buffer | Returns: Probably an off-heap copy of the given buffer.The buffer to copy. buf)Allocates a new off-heap copy of the given buffer, unless the cost of doing so is too high. |
| protected final Buffer | Returns: Probably an off-heap copy of the given buffer.The buffer to copy. buf)Allocates a new off-heap copy of the given buffer, unless the cost of doing so is too high. |
| pack-priv final NioProcessor | |
| protected final SelectionKey | selectionKey()
Return the current |
| protected final void | writeLoopComplete(boolean
true if all messages were written during the write loop, false otherwise.Overrides io. |
| ch | back to summary |
|---|---|
| private final SelectableChannel ch | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| nioProcessor | back to summary |
|---|---|
| private final NioProcessor nioProcessor | |
| readInterestOp | back to summary |
|---|---|
| private final int readInterestOp | |
| selectionKey | back to summary |
|---|---|
| private volatile SelectionKey selectionKey | |
| AbstractNioChannel | back to summary |
|---|---|
| protected AbstractNioChannel(P parent, EventLoop eventLoop, boolean supportingDisconnect, ReadHandleFactory defaultReadHandleFactory, WriteHandleFactory defaultWriteHandleFactory, SelectableChannel ch, int readInterestOp) Create a new instance
| |
| closeTransportNow | back to summary |
|---|---|
| private void closeTransportNow() | |
| doClearScheduledRead | back to summary |
|---|---|
| protected final void doClearScheduledRead() Overrides io. Doc from io. Clear any previous scheduled read. By default, this method does nothing but implementations might override it to add extra logic.
| |
| doClose | back to summary |
|---|---|
| protected final void doClose() throws Exception Implements abstract io. Doc from io. Close the | |
| doRead | back to summary |
|---|---|
| protected final void doRead(boolean wasReadPendingAlready) Implements abstract io. Doc from io. Schedule a read operation. | |
| finishConnectNow | back to summary |
|---|---|
| private void finishConnectNow() | |
| ioBufferAllocator | back to summary |
|---|---|
| private static BufferAllocator ioBufferAllocator(BufferAllocator bufferAllocator) | |
| isOpen | back to summary |
|---|---|
| public final boolean isOpen() Implements io. Doc from io. Returns
| |
| isWriteFlushedScheduled | back to summary |
|---|---|
| protected final boolean isWriteFlushedScheduled() Overrides io. Doc from io. Returns
| |
| javaChannel | back to summary |
|---|---|
| protected SelectableChannel javaChannel() | |
| newDirectBuffer | back to summary |
|---|---|
| protected final Buffer newDirectBuffer(Buffer buf) Allocates a new off-heap copy of the given buffer, unless the cost of doing so is too high. The given buffer is closed if a copy is created, or returned directly. | |
| newDirectBuffer | back to summary |
|---|---|
| protected final Buffer newDirectBuffer(Resource<?> holder, Buffer buf) Allocates a new off-heap copy of the given buffer, unless the cost of doing so is too high. The given holder is closed regardless. | |
| nioProcessor | back to summary |
|---|---|
| pack-priv final NioProcessor nioProcessor() | |
| selectionKey | back to summary |
|---|---|
| protected final SelectionKey selectionKey() Return the current | |
| writeLoopComplete | back to summary |
|---|---|
| protected final void writeLoopComplete(boolean allWritten) Overrides io. Doc from io. Called once the write loop completed. Subclasses might override this method for custom logic but should also call super.
| |