Class EmbeddedChannel

  • All Implemented Interfaces:
    java.lang.Comparable<Channel>, Channel

    class EmbeddedChannel
    extends AbstractChannel
    TODO Make EmbeddedChannel implement ChannelConfig and ChannelSink to reduce overhead. TODO Do not extend AbstractChannel to reduce overhead and remove the internal-use-only constructor in AbstractChannel.
    • Field Detail

      • DUMMY_ID

        private static final java.lang.Integer DUMMY_ID
      • localAddress

        private final java.net.SocketAddress localAddress
      • remoteAddress

        private final java.net.SocketAddress remoteAddress
    • Method Detail

      • getConfig

        public ChannelConfig getConfig()
        Description copied from interface: Channel
        Returns the configuration of this channel.
      • getLocalAddress

        public java.net.SocketAddress getLocalAddress()
        Description copied from interface: Channel
        Returns the local address where this channel is bound to. The returned SocketAddress is supposed to be down-cast into more concrete type such as InetSocketAddress to retrieve the detailed information.
        Returns:
        the local address of this channel. null if this channel is not bound.
      • getRemoteAddress

        public java.net.SocketAddress getRemoteAddress()
        Description copied from interface: Channel
        Returns the remote address where this channel is connected to. The returned SocketAddress is supposed to be down-cast into more concrete type such as InetSocketAddress to retrieve the detailed information.
        Returns:
        the remote address of this channel. null if this channel is not connected. If this channel is not connected but it can receive messages from arbitrary remote addresses (e.g. DatagramChannel, use MessageEvent.getRemoteAddress() to determine the origination of the received message as this method will return null.
      • isBound

        public boolean isBound()
        Description copied from interface: Channel
        Returns true if and only if this channel is bound to a local address.
      • isConnected

        public boolean isConnected()
        Description copied from interface: Channel
        Returns true if and only if this channel is connected to a remote address.