Home / Class/ AbstractKQueueChannel Class — netty Architecture

AbstractKQueueChannel Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  e50a36fb_84e6_15bc_5dc3_edd4246018f8["AbstractKQueueChannel"]
  4fc08dac_39ea_00be_b5ca_bc44decb1b8f["AbstractKQueueChannel.java"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|defined in| 4fc08dac_39ea_00be_b5ca_bc44decb1b8f
  4e3314ee_1f59_9e57_9c0f_1e15c932c0d8["AbstractKQueueChannel()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| 4e3314ee_1f59_9e57_9c0f_1e15c932c0d8
  8b0e5ddf_bd49_9012_2c2b_112b8b2e4acd["isCompatible()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| 8b0e5ddf_bd49_9012_2c2b_112b8b2e4acd
  22940442_9f71_815e_a1a6_0105e3ef2ab9["isSoErrorZero()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| 22940442_9f71_815e_a1a6_0105e3ef2ab9
  eca5ca1a_524d_8846_0575_6126bcf2b854["IoRegistration()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| eca5ca1a_524d_8846_0575_6126bcf2b854
  84b39f5f_c7d2_dcee_5da6_8a1f1c31bf37["FileDescriptor()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| 84b39f5f_c7d2_dcee_5da6_8a1f1c31bf37
  684a2bb9_79af_cb54_06e1_79f3ed633d1c["isActive()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| 684a2bb9_79af_cb54_06e1_79f3ed633d1c
  7e3b59fe_eb8f_0f46_2cc2_0772753e695e["ChannelMetadata()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| 7e3b59fe_eb8f_0f46_2cc2_0772753e695e
  5a1a5e83_2a80_174b_7406_22a4665158a1["doClose()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| 5a1a5e83_2a80_174b_7406_22a4665158a1
  1b3578e5_fefa_e03c_cbbf_ecf376fcd1f7["doDisconnect()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| 1b3578e5_fefa_e03c_cbbf_ecf376fcd1f7
  fd4ecad6_187c_010d_0ddb_19bc7bba29d5["resetCachedAddresses()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| fd4ecad6_187c_010d_0ddb_19bc7bba29d5
  40d89fd4_47a3_66e5_2edc_bccaf14965af["isOpen()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| 40d89fd4_47a3_66e5_2edc_bccaf14965af
  a4a8f927_f774_6570_befa_48261b11f202["doDeregister()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| a4a8f927_f774_6570_befa_48261b11f202
  eca00a86_f428_0f69_8ad6_a0b227157cd7["clearRdHup0()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8 -->|method| eca00a86_f428_0f69_8ad6_a0b227157cd7

Relationship Graph

Source Code

transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java lines 61–763

abstract class AbstractKQueueChannel extends AbstractChannel implements UnixChannel {

    private static final ChannelMetadata METADATA = new ChannelMetadata(false);
    /**
     * The future of the current connection attempt.  If not null, subsequent
     * connection attempts will fail.
     */
    private ChannelPromise connectPromise;
    private Future<?> connectTimeoutFuture;
    private SocketAddress requestedRemoteAddress;

    final BsdSocket socket;
    private IoRegistration registration;
    private boolean readFilterEnabled;
    private boolean writeFilterEnabled;

    boolean readReadyRunnablePending;
    boolean inputClosedSeenErrorOnRead;
    protected volatile boolean active;
    private volatile SocketAddress local;
    private volatile SocketAddress remote;

    AbstractKQueueChannel(Channel parent, BsdSocket fd, boolean active) {
        super(parent);
        socket = checkNotNull(fd, "fd");
        this.active = active;
        if (active) {
            // Directly cache the remote and local addresses
            // See https://github.com/netty/netty/issues/2359
            local = fd.localAddress();
            remote = fd.remoteAddress();
        }
    }

    AbstractKQueueChannel(Channel parent, BsdSocket fd, SocketAddress remote) {
        super(parent);
        socket = checkNotNull(fd, "fd");
        active = true;
        // Directly cache the remote and local addresses
        // See https://github.com/netty/netty/issues/2359
        this.remote = remote;
        local = fd.localAddress();
    }

    @Override
    protected boolean isCompatible(EventLoop loop) {
        return loop instanceof IoEventLoop && ((IoEventLoop) loop).isCompatible(AbstractKQueueUnsafe.class);
    }

    static boolean isSoErrorZero(BsdSocket fd) {
        try {
            return fd.getSoError() == 0;
        } catch (IOException e) {
            throw new ChannelException(e);
        }
    }

    protected final IoRegistration registration() {
        assert registration != null;
        return registration;
    }

    @Override
    public final FileDescriptor fd() {
        return socket;
    }

    @Override
    public boolean isActive() {
        return active;
    }

    @Override
    public ChannelMetadata metadata() {
        return METADATA;
    }

    @Override
    protected void doClose() throws Exception {
        active = false;
        // Even if we allow half closed sockets we should give up on reading. Otherwise we may allow a read attempt on a

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free