Home / Class/ EpollDomainSocketChannel Class — netty Architecture

EpollDomainSocketChannel Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  46154c81_3c34_f76b_4a7d_c14237da1551["EpollDomainSocketChannel"]
  b7581c9c_c732_6192_ad19_22dfd8e46afd["EpollDomainSocketChannel.java"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|defined in| b7581c9c_c732_6192_ad19_22dfd8e46afd
  b84d2805_4376_4957_0285_9c5c00b3eadd["EpollDomainSocketChannel()"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|method| b84d2805_4376_4957_0285_9c5c00b3eadd
  fa63c4d6_3212_460b_d3e1_c233cf05ed4a["AbstractEpollUnsafe()"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|method| fa63c4d6_3212_460b_d3e1_c233cf05ed4a
  952dd86f_80bd_66e6_4369_02c0aabddb1b["DomainSocketAddress()"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|method| 952dd86f_80bd_66e6_4369_02c0aabddb1b
  1c2b297e_b4b3_5f40_6d03_cc17f1fbb049["doBind()"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|method| 1c2b297e_b4b3_5f40_6d03_cc17f1fbb049
  8d402daf_6305_80ac_f984_58a10fe711d5["EpollDomainSocketChannelConfig()"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|method| 8d402daf_6305_80ac_f984_58a10fe711d5
  d07cee57_298b_9176_7081_9ba4e2e04e8f["doConnect()"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|method| d07cee57_298b_9176_7081_9ba4e2e04e8f
  066d1a3d_42d2_4cdc_a68e_e040a2c0a73d["doWriteSingle()"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|method| 066d1a3d_42d2_4cdc_a68e_e040a2c0a73d
  652fedcf_bda3_88f0_14ac_98233bb0b9d2["Object()"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|method| 652fedcf_bda3_88f0_14ac_98233bb0b9d2
  61f7a509_04c6_5232_0d0f_6fe08c879439["PeerCredentials()"]
  46154c81_3c34_f76b_4a7d_c14237da1551 -->|method| 61f7a509_04c6_5232_0d0f_6fe08c879439

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDomainSocketChannel.java lines 32–192

public final class EpollDomainSocketChannel extends AbstractEpollStreamChannel implements DomainSocketChannel {
    private final EpollDomainSocketChannelConfig config = new EpollDomainSocketChannelConfig(this);

    private volatile DomainSocketAddress local;
    private volatile DomainSocketAddress remote;

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

    EpollDomainSocketChannel(Channel parent, FileDescriptor fd) {
        this(parent, new LinuxSocket(fd.intValue()));
    }

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

    public EpollDomainSocketChannel(Channel parent, LinuxSocket fd) {
        super(parent, fd);
        local = fd.localDomainSocketAddress();
        remote = fd.remoteDomainSocketAddress();
    }

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

    @Override
    protected AbstractEpollUnsafe newUnsafe() {
        return new EpollDomainUnsafe();
    }

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

    @Override
    protected DomainSocketAddress remoteAddress0() {
        return remote;
    }

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

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

    @Override
    protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception {
        if (super.doConnect(remoteAddress, localAddress)) {
            local = localAddress != null ? (DomainSocketAddress) localAddress : socket.localDomainSocketAddress();
            remote = (DomainSocketAddress) remoteAddress;
            return true;
        }
        return false;
    }

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

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

    @Override
    protected int doWriteSingle(ChannelOutboundBuffer in) throws Exception {
        Object msg = in.current();
        if (msg instanceof FileDescriptor && socket.sendFd(((FileDescriptor) msg).intValue()) > 0) {
            // File descriptor was written, so remove it.
            in.remove();
            return 1;

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free