Class AbstractNioMessageChannel

All Implemented Interfaces:
Channel, ChannelOutboundInvoker, AttributeMap, java.lang.Comparable<Channel>
Direct Known Subclasses:
NioDatagramChannel, NioSctpChannel, NioSctpServerChannel, NioServerDomainSocketChannel, NioServerSocketChannel

public abstract class AbstractNioMessageChannel extends AbstractNioChannel
AbstractNioChannel base class for Channels that operate on messages.
  • Field Details

    • inputShutdown

      boolean inputShutdown
  • Constructor Details

  • Method Details

    • newUnsafe

      protected AbstractNioChannel.AbstractNioUnsafe newUnsafe()
      Description copied from class: AbstractChannel
      Create a new AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel
      Specified by:
      newUnsafe in class AbstractChannel
    • doBeginRead

      protected void doBeginRead() throws java.lang.Exception
      Description copied from class: AbstractChannel
      Schedule a read operation.
      Overrides:
      doBeginRead in class AbstractNioChannel
      Throws:
      java.lang.Exception
    • continueReading

      protected boolean continueReading(RecvByteBufAllocator.Handle allocHandle)
    • doWrite

      protected void doWrite(ChannelOutboundBuffer in) throws java.lang.Exception
      Description copied from class: AbstractChannel
      Flush the content of the given buffer to the remote peer.
      Specified by:
      doWrite in class AbstractChannel
      Throws:
      java.lang.Exception
    • continueOnWriteError

      protected boolean continueOnWriteError()
      Returns true if we should continue the write loop on a write error.
    • closeOnReadError

      protected boolean closeOnReadError(java.lang.Throwable cause)
    • doReadMessages

      protected abstract int doReadMessages(java.util.List<java.lang.Object> buf) throws java.lang.Exception
      Read messages into the given array and return the amount which was read.
      Throws:
      java.lang.Exception
    • doWriteMessage

      protected abstract boolean doWriteMessage(java.lang.Object msg, ChannelOutboundBuffer in) throws java.lang.Exception
      Write a message to the underlying Channel.
      Returns:
      true if and only if the message has been written
      Throws:
      java.lang.Exception