Class AbstractIoUringStreamChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
io.netty.channel.uring.AbstractIoUringChannel
io.netty.channel.uring.AbstractIoUringStreamChannel
- All Implemented Interfaces:
Channel, ChannelOutboundInvoker, DuplexChannel, UnixChannel, AttributeMap, Comparable<Channel>
- Direct Known Subclasses:
IoUringDomainSocketChannel, IoUringSocketChannel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classAWritableByteChannelbacked by aByteBuf.protected classNested classes/interfaces inherited from class AbstractIoUringChannel
AbstractIoUringChannel.AbstractUringUnsafeNested classes/interfaces inherited from class AbstractChannel
AbstractChannel.AbstractUnsafeNested classes/interfaces inherited from interface Channel
Channel.Unsafe -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IoUringBufferRingprivate static final intMaximum bytes per chunk when converting a genericFileRegionto aByteBuffor the io_uring async send path.private static final InternalLoggerprivate static final ChannelMetadata(package private) long(package private) byte(package private) long(package private) byteFields inherited from class AbstractIoUringChannel
active, socket, writeTracker -
Constructor Summary
ConstructorsConstructorDescriptionAbstractIoUringStreamChannel(Channel parent, LinuxSocket socket, boolean active) AbstractIoUringStreamChannel(Channel parent, LinuxSocket socket, SocketAddress remote) -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidcancelOutstandingReads(IoRegistration registration, int numOutstandingReads) Cancel all outstanding readsprotected final voidcancelOutstandingWrites(IoRegistration registration, int numOutstandingWrites) Cancel all outstanding writesprotected final voiddoRegister(ChannelPromise promise) protected final voidPerforms the actual output shutdown.protected ObjectInvoked when a new message is added to aChannelOutboundBufferof thisAbstractChannel, so that theChannelimplementation converts the message to another.final booleanReturnstrueif and only if the remote peer shut down its output so that no more data is received from this channel.final boolean(package private) booleanfinal booleanDetermine if both the input and output of this channel have been shutdown.protected final booleanmetadata()Create a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannelprotected booleanshouldCompleteReadLoop(int flags, boolean multishot) final ChannelFutureshutdown()Will shutdown the input and output sides of this channel.final ChannelFutureshutdown(ChannelPromise promise) Will shutdown the input and output sides of this channel.private static voidshutdownDone(ChannelFuture shutdownOutputFuture, ChannelFuture shutdownInputFuture, ChannelPromise promise) final ChannelFuturefinal ChannelFutureshutdownInput(ChannelPromise promise) Will shutdown the input and notifyChannelPromise.private voidshutdownInput0(ChannelPromise promise) final ChannelFuturefinal ChannelFutureshutdownOutput(ChannelPromise promise) Will shutdown the output and notifyChannelPromise.private voidshutdownOutputDone(ChannelFuture shutdownOutputFuture, ChannelPromise promise) protected booleansocketIsEmpty(int flags) Return if the socket is guaranteed to be empty when the submitted io was executed and the completion event be created.Methods inherited from class AbstractIoUringChannel
allowMultiShotPollIn, autoReadCleared, checkResolvable, doBeginRead, doBind, doClose, doDeregister, doDisconnect, doShutdownOutput, doWrite, fd, isActive, isCompatible, isOpen, localAddress0, newDirectBuffer, newDirectBuffer, nextOpsId, registration, remoteAddress0, resetCachedAddresses, schedulePollRdHup, scheduleWriteIfNeeded, submitAndRunNowMethods inherited from class AbstractChannel
closeFuture, compareTo, doRegister, equals, eventLoop, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, localAddress, maxMessagesPerWrite, newChannelPipeline, newId, parent, pipeline, remoteAddress, toString, unsafe, validateFileRegion, voidPromiseMethods inherited from class DefaultAttributeMap
attr, hasAttrMethods inherited from interface AttributeMap
attr, hasAttrMethods inherited from interface Channel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, config, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, eventLoop, flush, getOption, id, isActive, isOpen, isRegistered, isWritable, localAddress, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, setOption, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushMethods inherited from interface Comparable
compareTo
-
Field Details
-
logger
-
METADATA
-
FILE_REGION_MAX_CHUNK_SIZE
private static final int FILE_REGION_MAX_CHUNK_SIZEMaximum bytes per chunk when converting a genericFileRegionto aByteBuffor the io_uring async send path. Overridable via theio.netty.iouring.fileRegionChunkSizesystem property; capped at 16 MiB to guard against pathological configurations that would risk direct-memory OOM. -
writeOpCode
byte writeOpCode -
writeId
long writeId -
readOpCode
byte readOpCode -
readId
long readId -
bufferRing
-
-
Constructor Details
-
AbstractIoUringStreamChannel
AbstractIoUringStreamChannel(Channel parent, LinuxSocket socket, boolean active) -
AbstractIoUringStreamChannel
AbstractIoUringStreamChannel(Channel parent, LinuxSocket socket, SocketAddress remote)
-
-
Method Details
-
isStreamSocket
protected final boolean isStreamSocket()- Specified by:
isStreamSocketin classAbstractIoUringChannel
-
metadata
Description copied from interface:Channel -
newUnsafe
Description copied from class:AbstractChannelCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannel- Specified by:
newUnsafein classAbstractChannel
-
shutdown
Description copied from interface:DuplexChannelWill shutdown the input and output sides of this channel.- Specified by:
shutdownin interfaceDuplexChannel- Returns:
- will be completed when both shutdown operations complete.
-
shutdown
Description copied from interface:DuplexChannelWill shutdown the input and output sides of this channel.- Specified by:
shutdownin interfaceDuplexChannel- Parameters:
promise- will be completed when both shutdown operations complete.- Returns:
- will be completed when both shutdown operations complete.
-
doShutdownOutput0
Description copied from class:AbstractIoUringChannelPerforms the actual output shutdown. Overridden by subclasses that support it.- Overrides:
doShutdownOutput0in classAbstractIoUringChannel- Throws:
Exception
-
shutdownInput0
-
isOutputShutdown
public final boolean isOutputShutdown()- Specified by:
isOutputShutdownin interfaceDuplexChannel- See Also:
-
isInputShutdown
public final boolean isInputShutdown()Description copied from interface:DuplexChannelReturnstrueif and only if the remote peer shut down its output so that no more data is received from this channel. Note that the semantic of this method is different from that ofSocket.shutdownInput()andSocket.isInputShutdown().- Specified by:
isInputShutdownin interfaceDuplexChannel
-
isShutdown
public final boolean isShutdown()Description copied from interface:DuplexChannelDetermine if both the input and output of this channel have been shutdown.- Specified by:
isShutdownin interfaceDuplexChannel
-
shutdownOutput
- Specified by:
shutdownOutputin interfaceDuplexChannel- See Also:
-
shutdownOutput
Description copied from interface:DuplexChannelWill shutdown the output and notifyChannelPromise.- Specified by:
shutdownOutputin interfaceDuplexChannel- See Also:
-
shutdownInput
- Specified by:
shutdownInputin interfaceDuplexChannel- See Also:
-
shutdownInput
Description copied from interface:DuplexChannelWill shutdown the input and notifyChannelPromise.- Specified by:
shutdownInputin interfaceDuplexChannel- See Also:
-
shutdownOutputDone
-
shutdownDone
private static void shutdownDone(ChannelFuture shutdownOutputFuture, ChannelFuture shutdownInputFuture, ChannelPromise promise) -
doRegister
Description copied from class:AbstractChannelIs called after theChannelis registered with itsEventLoopas part of the register process. Subclasses may override this method- Overrides:
doRegisterin classAbstractIoUringChannel- Parameters:
promise-ChannelPromisethat must be notified once done to continue the registration.
-
filterOutboundMessage
Description copied from class:AbstractChannelInvoked when a new message is added to aChannelOutboundBufferof thisAbstractChannel, so that theChannelimplementation converts the message to another. (e.g. heap buffer -> direct buffer)- Overrides:
filterOutboundMessagein classAbstractIoUringChannel
-
cancelOutstandingReads
Description copied from class:AbstractIoUringChannelCancel all outstanding reads- Specified by:
cancelOutstandingReadsin classAbstractIoUringChannel- Parameters:
registration- theIoRegistration.numOutstandingReads- the number of outstanding reads, or-1if multi-shot was used.
-
cancelOutstandingWrites
Description copied from class:AbstractIoUringChannelCancel all outstanding writes- Specified by:
cancelOutstandingWritesin classAbstractIoUringChannel- Parameters:
registration- theIoRegistration.numOutstandingWrites- the number of outstanding writes.
-
socketIsEmpty
protected boolean socketIsEmpty(int flags) Description copied from class:AbstractIoUringChannelReturn if the socket is guaranteed to be empty when the submitted io was executed and the completion event be created.- Specified by:
socketIsEmptyin classAbstractIoUringChannel- Parameters:
flags- the flags that were part of the completion- Returns:
trueif empty.
-
shouldCompleteReadLoop
protected boolean shouldCompleteReadLoop(int flags, boolean multishot) -
isPollInFirst
boolean isPollInFirst()- Specified by:
isPollInFirstin classAbstractIoUringChannel
-