Home / Class/ KQueueServerDomainSocketChannel Class — netty Architecture

KQueueServerDomainSocketChannel Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  6ab3b865_9e00_5866_2cdd_b82a66aed0be["KQueueServerDomainSocketChannel"]
  e97c90ef_f223_4001_8aa0_8c792e4ee113["KQueueServerDomainSocketChannel.java"]
  6ab3b865_9e00_5866_2cdd_b82a66aed0be -->|defined in| e97c90ef_f223_4001_8aa0_8c792e4ee113
  b013bf57_3e3d_327a_f5e0_980544d1c867["KQueueServerDomainSocketChannel()"]
  6ab3b865_9e00_5866_2cdd_b82a66aed0be -->|method| b013bf57_3e3d_327a_f5e0_980544d1c867
  34fd160d_c574_9003_1f10_587d0e48f77c["Channel()"]
  6ab3b865_9e00_5866_2cdd_b82a66aed0be -->|method| 34fd160d_c574_9003_1f10_587d0e48f77c
  c9f36919_789a_6824_3360_f85ed840d91b["DomainSocketAddress()"]
  6ab3b865_9e00_5866_2cdd_b82a66aed0be -->|method| c9f36919_789a_6824_3360_f85ed840d91b
  74f9cc52_8842_36a2_e90d_8ff71a2c9c02["doBind()"]
  6ab3b865_9e00_5866_2cdd_b82a66aed0be -->|method| 74f9cc52_8842_36a2_e90d_8ff71a2c9c02
  61d4a3db_d2f2_7e01_320c_a620f47ecc31["doClose()"]
  6ab3b865_9e00_5866_2cdd_b82a66aed0be -->|method| 61d4a3db_d2f2_7e01_320c_a620f47ecc31
  d68efb2f_ac15_17f0_8a8e_72383fc3d5ed["KQueueServerChannelConfig()"]
  6ab3b865_9e00_5866_2cdd_b82a66aed0be -->|method| d68efb2f_ac15_17f0_8a8e_72383fc3d5ed

Relationship Graph

Source Code

transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueServerDomainSocketChannel.java lines 29–98

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

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

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

    public KQueueServerDomainSocketChannel(int fd) {
        this(new BsdSocket(fd), false);
    }

    KQueueServerDomainSocketChannel(BsdSocket socket, boolean active) {
        super(socket, active);
    }

    @Override
    protected Channel newChildChannel(int fd, byte[] addr, int offset, int len) throws Exception {
        return new KQueueDomainSocketChannel(this, new BsdSocket(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 KQueueServerChannelConfig 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 KQueueServerDomainSocketChannel class?
KQueueServerDomainSocketChannel is a class in the netty codebase, defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueServerDomainSocketChannel.java.
Where is KQueueServerDomainSocketChannel defined?
KQueueServerDomainSocketChannel is defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueServerDomainSocketChannel.java at line 29.

Analyze Your Own Codebase

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

Try Supermodel Free