Class AbstractEpollChannel

    • Field Detail

      • connectPromise

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

        private Future<?> connectTimeoutFuture
      • requestedRemoteAddress

        private java.net.SocketAddress requestedRemoteAddress
      • local

        private volatile java.net.SocketAddress local
      • remote

        private volatile java.net.SocketAddress remote
      • flags

        protected int flags
      • inputClosedSeenErrorOnRead

        boolean inputClosedSeenErrorOnRead
      • epollInReadyRunnablePending

        boolean epollInReadyRunnablePending
      • active

        protected volatile boolean active
    • Constructor Detail

      • AbstractEpollChannel

        AbstractEpollChannel​(LinuxSocket fd)
      • AbstractEpollChannel

        AbstractEpollChannel​(Channel parent,
                             LinuxSocket fd,
                             boolean active)
      • AbstractEpollChannel

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

      • isSoErrorZero

        static boolean isSoErrorZero​(Socket fd)
      • setFlag

        void setFlag​(int flag)
              throws java.io.IOException
        Throws:
        java.io.IOException
      • clearFlag

        void clearFlag​(int flag)
                throws java.io.IOException
        Throws:
        java.io.IOException
      • isFlagSet

        boolean isFlagSet​(int flag)
      • 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
      • resetCachedAddresses

        void resetCachedAddresses()
      • 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
      • isOpen

        public 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
      • doBeginRead

        protected final void doBeginRead()
                                  throws java.lang.Exception
        Description copied from class: AbstractChannel
        Schedule a read operation.
        Specified by:
        doBeginRead in class AbstractChannel
        Throws:
        java.lang.Exception
      • shouldBreakEpollInReady

        final boolean shouldBreakEpollInReady​(ChannelConfig config)
      • isAllowHalfClosure

        private static boolean isAllowHalfClosure​(ChannelConfig config)
      • clearEpollIn

        final void clearEpollIn()
      • modifyEvents

        private void modifyEvents()
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • doRegister

        protected void doRegister()
                           throws java.lang.Exception
        Description copied from class: AbstractChannel
        Is called after the Channel is registered with its EventLoop as part of the register process. Sub-classes may override this method
        Overrides:
        doRegister in class AbstractChannel
        Throws:
        java.lang.Exception
      • newDirectBuffer

        protected final ByteBuf newDirectBuffer​(ByteBuf buf)
        Returns an off-heap copy of the specified ByteBuf, and releases the original one.
      • newDirectBuffer

        protected final ByteBuf newDirectBuffer​(java.lang.Object holder,
                                                ByteBuf buf)
        Returns an off-heap copy of the specified ByteBuf, and releases the specified holder. The caller must ensure that the holder releases the original ByteBuf when the holder is released by this method.
      • checkResolvable

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

        protected final int doReadBytes​(ByteBuf byteBuf)
                                 throws java.lang.Exception
        Read bytes into the given ByteBuf and return the amount.
        Throws:
        java.lang.Exception
      • doWriteBytes

        protected final int doWriteBytes​(ChannelOutboundBuffer in,
                                         ByteBuf buf)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doWriteOrSendBytes

        final long doWriteOrSendBytes​(ByteBuf data,
                                      java.net.InetSocketAddress remoteAddress,
                                      boolean fastOpen)
                               throws java.io.IOException
        Write bytes to the socket, with or without a remote address. Used for datagram and TCP client fast open writes.
        Throws:
        java.io.IOException
      • 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
      • doConnect

        protected boolean doConnect​(java.net.SocketAddress remoteAddress,
                                    java.net.SocketAddress localAddress)
                             throws java.lang.Exception
        Connect to the remote peer
        Throws:
        java.lang.Exception
      • doConnect0

        boolean doConnect0​(java.net.SocketAddress remote)
                    throws java.lang.Exception
        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