public abstract class AbstractNioByteChannel extends AbstractNioChannel
AbstractNioChannel
base class for Channel
s that operate on bytes.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractNioByteChannel.NioByteUnsafe |
AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafe
AbstractChannel.AbstractUnsafe
Channel.Unsafe
readInterestOp
Modifier | Constructor and Description |
---|---|
protected |
AbstractNioByteChannel(Channel parent,
SelectableChannel ch)
Create a new instance
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearOpWrite() |
protected abstract int |
doReadBytes(ByteBuf buf)
Read bytes into the given
ByteBuf and return the amount. |
protected void |
doWrite(ChannelOutboundBuffer in)
Flush the content of the given buffer to the remote peer.
|
protected int |
doWrite0(ChannelOutboundBuffer in)
Write objects to the OS.
|
protected abstract int |
doWriteBytes(ByteBuf buf)
|
protected abstract long |
doWriteFileRegion(FileRegion region)
Write a
FileRegion |
protected Object |
filterOutboundMessage(Object msg)
Invoked when a new message is added to a
ChannelOutboundBuffer of this AbstractChannel , so that
the Channel implementation converts the message to another. |
protected void |
incompleteWrite(boolean setOpWrite) |
protected boolean |
isInputShutdown0() |
ChannelMetadata |
metadata()
|
protected AbstractNioChannel.AbstractNioUnsafe |
newUnsafe()
Create a new
AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel |
protected void |
setOpWrite() |
protected abstract ChannelFuture |
shutdownInput()
Shutdown the input side of the channel.
|
clearReadPending, doBeginRead, doClose, doConnect, doDeregister, doFinishConnect, doRegister, eventLoop, isCompatible, isOpen, isReadPending, javaChannel, newDirectBuffer, newDirectBuffer, selectionKey, setReadPending, unsafe
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, doDisconnect, doShutdownOutput, equals, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlush
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
attr, hasAttr
protected AbstractNioByteChannel(Channel parent, SelectableChannel ch)
parent
- the parent Channel
by which this instance was created. May be null
ch
- the underlying SelectableChannel
on which it operatesprotected abstract ChannelFuture shutdownInput()
protected boolean isInputShutdown0()
protected AbstractNioChannel.AbstractNioUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
instance which will be used for the life-time of the Channel
newUnsafe
in class AbstractChannel
public ChannelMetadata metadata()
Channel
protected final int doWrite0(ChannelOutboundBuffer in) throws Exception
in
- the collection which contains objects to write.ChannelConfig.getWriteSpinCount()
. The typical use cases are as follows:
ByteBuf
(or other empty content)
is encounteredChannelUtils.WRITE_STATUS_SNDBUF_FULL
- if an attempt to write data was made to the OS, but no
data was acceptedException
- if an I/O exception occurs during write.protected void doWrite(ChannelOutboundBuffer in) throws Exception
AbstractChannel
doWrite
in class AbstractChannel
Exception
protected final Object filterOutboundMessage(Object msg)
AbstractChannel
ChannelOutboundBuffer
of this AbstractChannel
, so that
the Channel
implementation converts the message to another. (e.g. heap buffer -> direct buffer)filterOutboundMessage
in class AbstractChannel
protected final void incompleteWrite(boolean setOpWrite)
protected abstract long doWriteFileRegion(FileRegion region) throws Exception
FileRegion
region
- the FileRegion
from which the bytes should be writtenException
protected abstract int doReadBytes(ByteBuf buf) throws Exception
ByteBuf
and return the amount.Exception
protected final void setOpWrite()
protected final void clearOpWrite()
Copyright © 2008–2024 The Netty Project. All rights reserved.