Home / Class/ EpollServerDomainSocketChannel Class — netty Architecture

EpollServerDomainSocketChannel Class — netty Architecture

Architecture documentation for the EpollServerDomainSocketChannel class in EpollServerDomainSocketChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  25cf3904_97c1_9b10_b0ff_87d41f42214a["EpollServerDomainSocketChannel"]
  846f2c93_13e2_fa99_065e_acda556941bf["EpollServerDomainSocketChannel.java"]
  25cf3904_97c1_9b10_b0ff_87d41f42214a -->|defined in| 846f2c93_13e2_fa99_065e_acda556941bf
  aa11e7a6_e5a9_1cb0_a005_6f93752edf21["EpollServerDomainSocketChannel()"]
  25cf3904_97c1_9b10_b0ff_87d41f42214a -->|method| aa11e7a6_e5a9_1cb0_a005_6f93752edf21
  f0a93f29_8b55_7dc4_1652_b807d427a124["Channel()"]
  25cf3904_97c1_9b10_b0ff_87d41f42214a -->|method| f0a93f29_8b55_7dc4_1652_b807d427a124
  a1f6f16c_12f7_fae5_cfb5_04158f156560["DomainSocketAddress()"]
  25cf3904_97c1_9b10_b0ff_87d41f42214a -->|method| a1f6f16c_12f7_fae5_cfb5_04158f156560
  5601d88c_6924_e7fb_5095_876f29918bdf["doBind()"]
  25cf3904_97c1_9b10_b0ff_87d41f42214a -->|method| 5601d88c_6924_e7fb_5095_876f29918bdf
  a59ac958_0d1b_11c1_5b18_b83d68f25ccf["doClose()"]
  25cf3904_97c1_9b10_b0ff_87d41f42214a -->|method| a59ac958_0d1b_11c1_5b18_b83d68f25ccf
  0b20a72d_15de_7c61_f8b2_d8736587eefb["EpollServerChannelConfig()"]
  25cf3904_97c1_9b10_b0ff_87d41f42214a -->|method| 0b20a72d_15de_7c61_f8b2_d8736587eefb

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollServerDomainSocketChannel.java lines 30–107

public final class EpollServerDomainSocketChannel extends AbstractEpollServerChannel
        implements ServerDomainSocketChannel {
    private static final InternalLogger logger = InternalLoggerFactory.getInstance(
            EpollServerDomainSocketChannel.class);

    private final EpollServerChannelConfig config = new EpollServerChannelConfig(this);
    private volatile DomainSocketAddress local;

    public EpollServerDomainSocketChannel() {
        super(newSocketDomain(), false);
    }

    public EpollServerDomainSocketChannel(int fd) {
        super(fd);
    }

    public EpollServerDomainSocketChannel(int fd, boolean active) {
        super(new LinuxSocket(fd), active);
    }

    EpollServerDomainSocketChannel(LinuxSocket fd) {
        super(fd);
    }

    EpollServerDomainSocketChannel(LinuxSocket fd, boolean active) {
        super(fd, active);
    }

    @Override
    protected Channel newChildChannel(int fd, byte[] addr, int offset, int len) throws Exception {
        return new EpollDomainSocketChannel(this, new Socket(fd));
    }

    @Override
    protected DomainSocketAddress localAddress0() {
        return local;
    }

    @Override
    protected void doBind(SocketAddress localAddress) throws Exception {
        socket.bind(localAddress);
        socket.listen(config.getBacklog());
        local = (DomainSocketAddress) localAddress;
        active = true;
    }

    @Override
    protected void doClose() throws Exception {
        try {
            super.doClose();
        } finally {
            DomainSocketAddress local = this.local;
            if (local != null) {
                // Delete the socket file if possible.
                File socketFile = new File(local.path());
                boolean success = socketFile.delete();
                if (!success && logger.isDebugEnabled()) {
                    logger.debug("Failed to delete a domain socket file: {}", local.path());
                }
            }
        }
    }

    @Override
    public EpollServerChannelConfig config() {
        return config;
    }

    @Override
    public DomainSocketAddress remoteAddress() {
        return (DomainSocketAddress) super.remoteAddress();
    }

    @Override
    public DomainSocketAddress localAddress() {
        return (DomainSocketAddress) super.localAddress();
    }
}

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free