Home / Class/ KQueueServerSocketChannel Class — netty Architecture

KQueueServerSocketChannel Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  c9cbb2a9_26f3_341f_e287_2d2b409ba5ec["KQueueServerSocketChannel"]
  ce57cd30_f7be_ab1b_120e_24bb115c775b["KQueueServerSocketChannel.java"]
  c9cbb2a9_26f3_341f_e287_2d2b409ba5ec -->|defined in| ce57cd30_f7be_ab1b_120e_24bb115c775b
  cfc967d5_95c8_6e88_9af5_6bf2551a213a["KQueueServerSocketChannel()"]
  c9cbb2a9_26f3_341f_e287_2d2b409ba5ec -->|method| cfc967d5_95c8_6e88_9af5_6bf2551a213a
  3bedb71f_dcb3_221c_d318_2faa467bbd9f["doBind()"]
  c9cbb2a9_26f3_341f_e287_2d2b409ba5ec -->|method| 3bedb71f_dcb3_221c_d318_2faa467bbd9f
  e0c06953_199c_4ba8_5df0_bdc9213fcfb9["InetSocketAddress()"]
  c9cbb2a9_26f3_341f_e287_2d2b409ba5ec -->|method| e0c06953_199c_4ba8_5df0_bdc9213fcfb9
  5c32007e_e39a_c4e0_947a_3052c3d0c37f["KQueueServerSocketChannelConfig()"]
  c9cbb2a9_26f3_341f_e287_2d2b409ba5ec -->|method| 5c32007e_e39a_c4e0_947a_3052c3d0c37f
  b69a5396_472c_4f83_7061_83cf9b897ee5["Channel()"]
  c9cbb2a9_26f3_341f_e287_2d2b409ba5ec -->|method| b69a5396_472c_4f83_7061_83cf9b897ee5

Relationship Graph

Source Code

transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueServerSocketChannel.java lines 27–80

public final class KQueueServerSocketChannel extends AbstractKQueueServerChannel implements ServerSocketChannel {
    private final KQueueServerSocketChannelConfig config;

    public KQueueServerSocketChannel() {
        super(newSocketStream(), false);
        config = new KQueueServerSocketChannelConfig(this);
    }

    public KQueueServerSocketChannel(int fd) {
        // Must call this constructor to ensure this object's local address is configured correctly.
        // The local address can only be obtained from a Socket object.
        this(new BsdSocket(fd));
    }

    KQueueServerSocketChannel(BsdSocket fd) {
        super(fd);
        config = new KQueueServerSocketChannelConfig(this);
    }

    KQueueServerSocketChannel(BsdSocket fd, boolean active) {
        super(fd, active);
        config = new KQueueServerSocketChannelConfig(this);
    }

    @Override
    protected void doBind(SocketAddress localAddress) throws Exception {
        super.doBind(localAddress);
        socket.listen(config.getBacklog());
        if (config.isTcpFastOpen()) {
            socket.setTcpFastOpen(true);
        }
        active = true;
    }

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

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

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

    @Override
    protected Channel newChildChannel(int fd, byte[] address, int offset, int len) throws Exception {
        return new KQueueSocketChannel(this, new BsdSocket(fd), address(address, offset, len));
    }
}

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free