Class NioServerDomainSocketChannel

All Implemented Interfaces:
Channel, ChannelOutboundInvoker, ServerChannel, AttributeMap, java.lang.Comparable<Channel>

public final class NioServerDomainSocketChannel extends AbstractNioMessageChannel implements ServerChannel
A ServerChannel implementation which uses NIO selector based implementation to support UNIX Domain Sockets. This is only supported when using Java 16+.
  • Field Details

    • OPEN_SERVER_SOCKET_CHANNEL_WITH_FAMILY

      private static final java.lang.reflect.Method OPEN_SERVER_SOCKET_CHANNEL_WITH_FAMILY
    • logger

      private static final InternalLogger logger
    • METADATA

      private static final ChannelMetadata METADATA
    • DEFAULT_SELECTOR_PROVIDER

      private static final java.nio.channels.spi.SelectorProvider DEFAULT_SELECTOR_PROVIDER
    • config

    • bound

      private volatile boolean bound
  • Constructor Details

    • NioServerDomainSocketChannel

      public NioServerDomainSocketChannel()
      Create a new instance
    • NioServerDomainSocketChannel

      public NioServerDomainSocketChannel(java.nio.channels.spi.SelectorProvider provider)
      Create a new instance using the given SelectorProvider.
    • NioServerDomainSocketChannel

      public NioServerDomainSocketChannel(java.nio.channels.ServerSocketChannel channel)
      Create a new instance using the given ServerSocketChannel.
  • Method Details

    • newChannel

      static java.nio.channels.ServerSocketChannel newChannel(java.nio.channels.spi.SelectorProvider provider)
    • javaChannel

      protected java.nio.channels.ServerSocketChannel javaChannel()
      Overrides:
      javaChannel in class AbstractNioChannel
    • config

      public ChannelConfig config()
      Description copied from interface: Channel
      Returns the configuration of this channel.
      Specified by:
      config in interface Channel
    • metadata

      public ChannelMetadata metadata()
      Description copied from interface: Channel
      Return the ChannelMetadata of the Channel which describe the nature of the Channel.
      Specified by:
      metadata 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
    • doBind

      protected void doBind(java.net.SocketAddress localAddress) 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
    • 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
    • doReadMessages

      protected int doReadMessages(java.util.List<java.lang.Object> buf) throws java.lang.Exception
      Description copied from class: AbstractNioMessageChannel
      Read messages into the given array and return the amount which was read.
      Specified by:
      doReadMessages in class AbstractNioMessageChannel
      Throws:
      java.lang.Exception
    • doWriteMessage

      protected boolean doWriteMessage(java.lang.Object msg, ChannelOutboundBuffer in) throws java.lang.Exception
      Description copied from class: AbstractNioMessageChannel
      Write a message to the underlying Channel.
      Specified by:
      doWriteMessage in class AbstractNioMessageChannel
      Returns:
      true if and only if the message has been written
      Throws:
      java.lang.Exception
    • doClose

      protected void doClose() throws java.lang.Exception
      Description copied from class: AbstractChannel
      Close the Channel
      Overrides:
      doClose in class AbstractNioChannel
      Throws:
      java.lang.Exception
    • localAddress0

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

      protected java.net.SocketAddress remoteAddress0()
      Description copied from class: AbstractChannel
      Return the SocketAddress which the Channel is connected to.
      Specified by:
      remoteAddress0 in class AbstractChannel
    • closeOnReadError

      protected boolean closeOnReadError(java.lang.Throwable cause)
      Overrides:
      closeOnReadError in class AbstractNioMessageChannel
    • doConnect

      protected boolean doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
      Description copied from class: AbstractNioChannel
      Connect to the remote peer
      Specified by:
      doConnect in class AbstractNioChannel
      Throws:
      java.lang.Exception
    • doFinishConnect

      protected void doFinishConnect() throws java.lang.Exception
      Description copied from class: AbstractNioChannel
      Finish the connect
      Specified by:
      doFinishConnect in class AbstractNioChannel
      Throws:
      java.lang.Exception