Class AbstractIoUringChannel

    • Field Detail

      • active

        protected volatile boolean active
      • opsId

        private short opsId
      • pollInId

        private long pollInId
      • pollOutId

        private long pollOutId
      • pollRdhupId

        private long pollRdhupId
      • connectId

        private long connectId
      • ioState

        private byte ioState
      • numOutstandingWrites

        private short numOutstandingWrites
      • numOutstandingReads

        private short numOutstandingReads
      • readPending

        private boolean readPending
      • inReadComplete

        private boolean inReadComplete
      • socketHasMoreData

        private boolean socketHasMoreData
      • inputClosedSeenErrorOnRead

        private boolean inputClosedSeenErrorOnRead
      • connectPromise

        private ChannelPromise connectPromise
        The future of the current connection attempt. If not null, subsequent connection attempts will fail.
      • connectTimeoutFuture

        private java.util.concurrent.ScheduledFuture<?> connectTimeoutFuture
      • requestedRemoteAddress

        private java.net.SocketAddress requestedRemoteAddress
      • remoteAddressMemory

        private java.nio.ByteBuffer remoteAddressMemory
      • local

        private volatile java.net.SocketAddress local
      • remote

        private volatile java.net.SocketAddress remote
    • Constructor Detail

      • AbstractIoUringChannel

        AbstractIoUringChannel​(Channel parent,
                               LinuxSocket socket,
                               boolean active)
      • AbstractIoUringChannel

        AbstractIoUringChannel​(Channel parent,
                               LinuxSocket fd,
                               java.net.SocketAddress remote)
    • Method Detail

      • autoReadCleared

        final void autoReadCleared()
      • clearRead

        private void clearRead()
      • nextOpsId

        protected final short nextOpsId()
        Returns the next id that should be used when submitting IoUringIoOps.
        Returns:
        opsId
      • isOpen

        public final boolean isOpen()
        Description copied from interface: Channel
        Returns true if the Channel is open and may get active later
        Specified by:
        isOpen in interface Channel
      • isActive

        public boolean isActive()
        Description copied from interface: Channel
        Return true if the Channel is active and so connected.
        Specified by:
        isActive in interface Channel
      • newDirectBuffer

        protected final ByteBuf newDirectBuffer​(ByteBuf buf)
      • allowMultiShotPollIn

        protected boolean allowMultiShotPollIn()
      • newDirectBuffer

        protected final ByteBuf newDirectBuffer​(java.lang.Object holder,
                                                ByteBuf buf)
      • cancelOutstandingReads

        protected abstract void cancelOutstandingReads​(IoRegistration registration,
                                                       int numOutstandingReads)
        Cancel all outstanding reads
        Parameters:
        registration - the IoRegistration.
        numOutstandingReads - the number of outstanding reads, or -1 if multi-shot was used.
      • cancelOutstandingWrites

        protected abstract void cancelOutstandingWrites​(IoRegistration registration,
                                                        int numOutstandingWrites)
        Cancel all outstanding writes
        Parameters:
        registration - the IoRegistration.
        numOutstandingWrites - the number of outstanding writes.
      • doDisconnect

        protected void doDisconnect()
                             throws java.lang.Exception
        Description copied from class: AbstractChannel
        Disconnect this Channel from its remote peer
        Specified by:
        doDisconnect in class AbstractChannel
        Throws:
        java.lang.Exception
      • freeRemoteAddressMemory

        private void freeRemoteAddressMemory()
      • freeMsgHdrArray

        private void freeMsgHdrArray()
      • doShutdownOutput

        protected final void doShutdownOutput()
                                       throws java.lang.Exception
        Retains every in-flight write's references before handing off to doShutdownOutput0(), so a write completion that races the shutdown still finds a live reference to release instead of one the outbound buffer already dropped.
        Overrides:
        doShutdownOutput in class AbstractChannel
        Throws:
        java.lang.Exception
      • doShutdownOutput0

        protected void doShutdownOutput0()
                                  throws java.lang.Exception
        Performs the actual output shutdown. Overridden by subclasses that support it.
        Throws:
        java.lang.Exception
      • doBeginReadNow

        private void doBeginReadNow()
      • scheduleWriteIfNeeded

        protected void scheduleWriteIfNeeded​(ChannelOutboundBuffer in,
                                             boolean submitAndRunNow)
      • submitAndRunNow

        protected void submitAndRunNow()
      • schedulePollOut

        private void schedulePollOut()
      • schedulePollRdHup

        final void schedulePollRdHup()
      • isStreamSocket

        protected abstract boolean isStreamSocket()
      • schedulePollAdd

        private long schedulePollAdd​(int ioMask,
                                     int mask,
                                     boolean multishot)
      • resetCachedAddresses

        final void resetCachedAddresses()
      • narrowUserData

        private static short narrowUserData​(long userData)
      • submitConnect

        private void submitConnect​(java.net.InetSocketAddress inetSocketAddress)
      • doBind

        protected void doBind​(java.net.SocketAddress local)
                       throws java.lang.Exception
        Description copied from class: AbstractChannel
        Bind the Channel to the SocketAddress
        Specified by:
        doBind in class AbstractChannel
        Throws:
        java.lang.Exception
      • checkResolvable

        protected static void checkResolvable​(java.net.InetSocketAddress addr)
      • localAddress0

        protected final java.net.SocketAddress localAddress0()
        Description copied from class: AbstractChannel
        Returns the SocketAddress which is bound locally.
        Specified by:
        localAddress0 in class AbstractChannel
      • isAllowHalfClosure

        private static boolean isAllowHalfClosure​(ChannelConfig config)
      • cancelConnectTimeoutFuture

        private void cancelConnectTimeoutFuture()
      • computeRemote

        private void computeRemote()
      • shouldBreakIoUringInReady

        private boolean shouldBreakIoUringInReady​(ChannelConfig config)
      • socketIsEmpty

        protected abstract boolean socketIsEmpty​(int flags)
        Return if the socket is guaranteed to be empty when the submitted io was executed and the completion event be created.
        Parameters:
        flags - the flags that were part of the completion
        Returns:
        true if empty.
      • isPollInFirst

        abstract boolean isPollInFirst()