Class AbstractIoUringChannel.AbstractUringUnsafe

java.lang.Object
io.netty.channel.AbstractChannel.AbstractUnsafe
io.netty.channel.uring.AbstractIoUringChannel.AbstractUringUnsafe
All Implemented Interfaces:
Channel.Unsafe, IoHandle, IoUringIoHandle, AutoCloseable
Direct Known Subclasses:
AbstractIoUringServerChannel.UringServerChannelUnsafe, AbstractIoUringStreamChannel.IoUringStreamUnsafe, IoUringDatagramChannel.IoUringDatagramChannelUnsafe
Enclosing class:
AbstractIoUringChannel

protected abstract class AbstractIoUringChannel.AbstractUringUnsafe extends AbstractChannel.AbstractUnsafe implements IoUringIoHandle
  • Field Details

  • Constructor Details

    • AbstractUringUnsafe

      protected AbstractUringUnsafe()
  • Method Details

    • scheduleWriteMultiple

      protected abstract int scheduleWriteMultiple(ChannelOutboundBuffer in)
      Schedule the write of multiple messages in the ChannelOutboundBuffer and returns the number of writeComplete(byte, int, int, long) calls that are expected because of the scheduled write.
    • scheduleWriteSingle

      protected abstract int scheduleWriteSingle(Object msg)
      Schedule the write of a single message and returns the number of writeComplete(byte, int, int, long) calls that are expected because of the scheduled write.
    • handle

      public final void handle(IoRegistration registration, IoEvent ioEvent)
      Description copied from interface: IoHandle
      Be called once there is something to handle.
      Specified by:
      handle in interface IoHandle
      Parameters:
      registration - the IoRegistration for this IoHandle.
      ioEvent - the IoEvent that must be handled. The IoEvent is only valid while this method is executed and so must not escape it.
    • unregistered

      public void unregistered()
      Description copied from interface: IoHandle
      Called once this IoHandle was unregistered and so will not receive any more events via IoHandle.handle(IoRegistration, IoEvent).
      Specified by:
      unregistered in interface IoHandle
    • handleDelayedClosed

      private void handleDelayedClosed()
    • pollAddComplete

      private void pollAddComplete(int res, int flags, short data)
    • close

      public final void close() throws Exception
      Description copied from interface: IoHandle
      Called once the IoHandle should be closed. Even once this method is called this handle might still receive events via IoHandle.handle(IoRegistration, IoEvent) (if it was previous be registered and so its IoHandle.registered() method was called) until the IoHandle.unregistered() method is called.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface IoHandle
      Throws:
      Exception
    • close

      protected void close(ChannelPromise promise, Throwable cause, ClosedChannelException closeCause)
      Overrides:
      close in class AbstractChannel.AbstractUnsafe
    • cancelOps

      private boolean cancelOps(boolean cancelConnect)
    • canCloseNow

      private boolean canCloseNow()
    • canCloseNow0

      protected boolean canCloseNow0()
    • closeNow

      private void closeNow()
    • flush0

      protected final void flush0()
      Overrides:
      flush0 in class AbstractChannel.AbstractUnsafe
    • fulfillConnectPromise

      private void fulfillConnectPromise(ChannelPromise promise, Throwable cause)
    • fulfillConnectPromise

      private void fulfillConnectPromise(ChannelPromise promise, boolean wasActive)
    • recvBufAllocHandle

      public final IoUringRecvByteAllocatorHandle recvBufAllocHandle()
      Description copied from interface: Channel.Unsafe
      Return the assigned RecvByteBufAllocator.Handle which will be used to allocate ByteBuf's when receiving data.
      Specified by:
      recvBufAllocHandle in interface Channel.Unsafe
      Overrides:
      recvBufAllocHandle in class AbstractChannel.AbstractUnsafe
    • shutdownInput

      final void shutdownInput(boolean allDataRead)
    • fireEventAndClose

      private void fireEventAndClose(Object evt)
    • schedulePollIn

      final void schedulePollIn()
    • isReadMultishot

      protected final boolean isReadMultishot()
    • readComplete

      private void readComplete(byte op, int res, int flags, short data)
    • readComplete0

      protected abstract void readComplete0(byte op, int res, int flags, short data, int outstandingCompletes)
      Called once a read was completed.
    • pollRdHup

      private void pollRdHup(int res)
      Called once POLLRDHUP event is ready to be processed
    • pollIn

      private void pollIn(int res, int flags, short data)
      Called once POLLIN event is ready to be processed
    • scheduleFirstReadIfNeeded

      private void scheduleFirstReadIfNeeded()
    • scheduleFirstRead

      private void scheduleFirstRead()
    • scheduleRead

      protected final void scheduleRead(boolean first)
    • scheduleRead0

      protected abstract int scheduleRead0(boolean first, boolean socketIsEmpty)
      Schedule a read and returns the number of readComplete(byte, int, int, short) calls that are expected because of the scheduled read.
      Parameters:
      first - true if this is the first read of a read loop.
      socketIsEmpty - true if the socket is guaranteed to be empty, false otherwise.
      Returns:
      the number of readComplete(byte, int, int, short) calls expected or -1 if readComplete(byte, int, int, short) is called until the read is cancelled (multi-shot).
    • pollOut

      private void pollOut(int res)
      Called once POLLOUT event is ready to be processed
      Parameters:
      res - the result.
    • writeComplete

      private void writeComplete(byte op, int res, int flags, long data)
      Called once a write was completed.
      Parameters:
      op - the op code.
      res - the result.
      flags - the flags.
      data - the data that was passed when submitting the op.
    • writeComplete0

      abstract boolean writeComplete0(byte op, int res, int flags, long data, int outstanding)
      Called once a write was completed.
      Parameters:
      op - the op code
      res - the result.
      flags - the flags.
      data - the data that was passed when submitting the op.
      outstanding - the outstanding write completions.
    • cancelComplete0

      void cancelComplete0(byte op, int res, int flags, short data)
      Called once a cancel was completed.
      Parameters:
      op - the op code
      res - the result.
      flags - the flags.
      data - the data that was passed when submitting the op.
    • connectComplete

      void connectComplete(byte op, int res, int flags, long data)
      Called once a connect was completed.
      Parameters:
      op - the op code.
      res - the result.
      flags - the flags.
      data - the data that was passed when submitting the op.
    • connect

      public void connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)
      Description copied from interface: Channel.Unsafe
      Connect the Channel of the given ChannelFuture with the given remote SocketAddress. If a specific local SocketAddress should be used it need to be given as argument. Otherwise just pass null to it. The ChannelPromise will get notified once the connect operation was complete.
      Specified by:
      connect in interface Channel.Unsafe
    • fillTFOInitData

      private void fillTFOInitData(MsgHdrMemory hdr, InetSocketAddress inetSocketAddress, ByteBuf initialData) throws Exception
      Throws:
      Exception
    • deregister

      public final void deregister(ChannelPromise promise)
      Description copied from interface: Channel.Unsafe
      Deregister the Channel of the ChannelPromise from EventLoop and notify the ChannelPromise once the operation was complete.
      Specified by:
      deregister in interface Channel.Unsafe
      Overrides:
      deregister in class AbstractChannel.AbstractUnsafe