Home / Class/ EpollSocketChannelUnsafe Class — netty Architecture

EpollSocketChannelUnsafe Class — netty Architecture

Architecture documentation for the EpollSocketChannelUnsafe class in EpollSocketChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9eafedd5_b756_9b33_f066_eaf25b2591d1["EpollSocketChannelUnsafe"]
  4aa9546a_b7a3_aed2_808c_e5a3633771d0["EpollSocketChannel.java"]
  9eafedd5_b756_9b33_f066_eaf25b2591d1 -->|defined in| 4aa9546a_b7a3_aed2_808c_e5a3633771d0
  8fc22c94_33e6_0d5a_7da6_4f4c7a4ff821["Executor()"]
  9eafedd5_b756_9b33_f066_eaf25b2591d1 -->|method| 8fc22c94_33e6_0d5a_7da6_4f4c7a4ff821

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java lines 158–179

    private final class EpollSocketChannelUnsafe extends EpollStreamUnsafe {
        @Override
        protected Executor prepareToClose() {
            try {
                // Check isOpen() first as otherwise it will throw a RuntimeException
                // when call getSoLinger() as the fd is not valid anymore.
                if (isOpen() && config().getSoLinger() > 0) {
                    // We need to cancel this key of the channel so we may not end up in a eventloop spin
                    // because we try to read or write until the actual close happens which may be later due
                    // SO_LINGER handling.
                    // See https://github.com/netty/netty/issues/4449
                    registration().cancel();
                    return GlobalEventExecutor.INSTANCE;
                }
            } catch (Throwable ignore) {
                // Ignore the error as the underlying channel may be closed in the meantime and so
                // getSoLinger() may produce an exception. In this case we just return null.
                // See https://github.com/netty/netty/issues/4449
            }
            return null;
        }
    }

Frequently Asked Questions

What is the EpollSocketChannelUnsafe class?
EpollSocketChannelUnsafe is a class in the netty codebase, defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java.
Where is EpollSocketChannelUnsafe defined?
EpollSocketChannelUnsafe is defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java at line 158.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free