Home / Class/ KQueueDomainSocketChannel Class — netty Architecture

KQueueDomainSocketChannel Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  d0ea4607_1280_0f8f_a651_3df11189484a["KQueueDomainSocketChannel"]
  694369b2_f52d_5597_6dfd_471c7990de34["KQueueDomainSocketChannel.java"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|defined in| 694369b2_f52d_5597_6dfd_471c7990de34
  2aa03585_c3ba_2a25_d3fb_294a7368dae7["KQueueDomainSocketChannel()"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|method| 2aa03585_c3ba_2a25_d3fb_294a7368dae7
  030b4b46_057e_d882_3b26_3f98e34935e4["AbstractKQueueUnsafe()"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|method| 030b4b46_057e_d882_3b26_3f98e34935e4
  72c2ac2f_d2b7_3b5b_3e4e_a6fc375540d1["DomainSocketAddress()"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|method| 72c2ac2f_d2b7_3b5b_3e4e_a6fc375540d1
  c812d5b1_e8aa_9b73_a6e0_fb9ece62904e["doBind()"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|method| c812d5b1_e8aa_9b73_a6e0_fb9ece62904e
  855a3a04_dd50_7e77_1a40_3e7c605fdfe5["KQueueDomainSocketChannelConfig()"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|method| 855a3a04_dd50_7e77_1a40_3e7c605fdfe5
  366a042b_1a45_63d6_ca40_83b4afebf815["doConnect()"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|method| 366a042b_1a45_63d6_ca40_83b4afebf815
  1e7cbbbb_adba_7fc9_da3a_d3f8324eba84["doWriteSingle()"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|method| 1e7cbbbb_adba_7fc9_da3a_d3f8324eba84
  4b6a52f7_c35b_1699_2c4d_7a86decf1aab["Object()"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|method| 4b6a52f7_c35b_1699_2c4d_7a86decf1aab
  d9061ab2_e9f3_8432_a951_03d0af995071["PeerCredentials()"]
  d0ea4607_1280_0f8f_a651_3df11189484a -->|method| d9061ab2_e9f3_8432_a951_03d0af995071

Relationship Graph

Source Code

transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueDomainSocketChannel.java lines 33–189

public final class KQueueDomainSocketChannel extends AbstractKQueueStreamChannel implements DomainSocketChannel {
    private final KQueueDomainSocketChannelConfig config = new KQueueDomainSocketChannelConfig(this);

    private volatile DomainSocketAddress local;
    private volatile DomainSocketAddress remote;

    public KQueueDomainSocketChannel() {
        super(null, newSocketDomain(), false);
    }

    public KQueueDomainSocketChannel(int fd) {
        this(null, new BsdSocket(fd));
    }

    KQueueDomainSocketChannel(Channel parent, BsdSocket fd) {
        super(parent, fd, true);
        local = fd.localDomainSocketAddress();
        remote = fd.remoteDomainSocketAddress();
    }

    @Override
    protected AbstractKQueueUnsafe newUnsafe() {
        return new KQueueDomainUnsafe();
    }

    @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 KQueueDomainSocketChannelConfig 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;
        }
        return super.doWriteSingle(in);
    }

    @Override
    protected Object filterOutboundMessage(Object msg) {
        if (msg instanceof FileDescriptor) {
            return msg;

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free