Home / Class/ EpollServerSocketChannel Class — netty Architecture

EpollServerSocketChannel Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  c1aed026_8c85_f1eb_3103_3eaa6aa73d75["EpollServerSocketChannel"]
  412ccf55_7023_d1eb_e18a_0b235450648b["EpollServerSocketChannel.java"]
  c1aed026_8c85_f1eb_3103_3eaa6aa73d75 -->|defined in| 412ccf55_7023_d1eb_e18a_0b235450648b
  d6c7c6c9_776f_ca5a_db7a_0b10b1b7f37b["EpollServerSocketChannel()"]
  c1aed026_8c85_f1eb_3103_3eaa6aa73d75 -->|method| d6c7c6c9_776f_ca5a_db7a_0b10b1b7f37b
  e8c1e3ea_0150_73b6_4451_e31130774334["doBind()"]
  c1aed026_8c85_f1eb_3103_3eaa6aa73d75 -->|method| e8c1e3ea_0150_73b6_4451_e31130774334
  27d12f8b_dec4_28f6_5023_35157701030b["InetSocketAddress()"]
  c1aed026_8c85_f1eb_3103_3eaa6aa73d75 -->|method| 27d12f8b_dec4_28f6_5023_35157701030b
  bbce7b66_640e_e5eb_e2d9_9c41b9755ec2["EpollServerSocketChannelConfig()"]
  c1aed026_8c85_f1eb_3103_3eaa6aa73d75 -->|method| bbce7b66_640e_e5eb_e2d9_9c41b9755ec2
  39d669a2_0612_3e9c_c8a6_1219d519349a["Channel()"]
  c1aed026_8c85_f1eb_3103_3eaa6aa73d75 -->|method| 39d669a2_0612_3e9c_c8a6_1219d519349a
  8f3d40e4_0d50_584c_eb76_944add3f8d8a["tcpMd5SigAddresses()"]
  c1aed026_8c85_f1eb_3103_3eaa6aa73d75 -->|method| 8f3d40e4_0d50_584c_eb76_944add3f8d8a
  e61f3b7c_f198_c082_1f7f_3a030ab3d8b2["setTcpMd5Sig()"]
  c1aed026_8c85_f1eb_3103_3eaa6aa73d75 -->|method| e61f3b7c_f198_c082_1f7f_3a030ab3d8b2

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollServerSocketChannel.java lines 39–119

public final class EpollServerSocketChannel extends AbstractEpollServerChannel implements ServerSocketChannel {

    private final EpollServerSocketChannelConfig config;
    private volatile Collection<InetAddress> tcpMd5SigAddresses = Collections.emptyList();

    public EpollServerSocketChannel() {
        this((SocketProtocolFamily) null);
    }

    /**
     * @deprecated  use {@link EpollServerSocketChannel#EpollServerSocketChannel(SocketProtocolFamily)}
     */
    @Deprecated
    public EpollServerSocketChannel(InternetProtocolFamily protocol) {
        super(newSocketStream(protocol), false);
        config = new EpollServerSocketChannelConfig(this);
    }

    public EpollServerSocketChannel(SocketProtocolFamily protocol) {
        super(newSocketStream(protocol), false);
        config = new EpollServerSocketChannelConfig(this);
    }

    public EpollServerSocketChannel(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 LinuxSocket(fd));
    }

    EpollServerSocketChannel(LinuxSocket fd) {
        super(fd);
        config = new EpollServerSocketChannelConfig(this);
    }

    EpollServerSocketChannel(LinuxSocket fd, boolean active) {
        super(fd, active);
        config = new EpollServerSocketChannelConfig(this);
    }

    @Override
    protected void doBind(SocketAddress localAddress) throws Exception {
        super.doBind(localAddress);
        final int tcpFastopen;
        if (IS_SUPPORTING_TCP_FASTOPEN_SERVER && (tcpFastopen = config.getTcpFastopen()) > 0) {
            socket.setTcpFastOpen(tcpFastopen);
        }
        socket.listen(config.getBacklog());
        active = true;
    }

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

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

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

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

    Collection<InetAddress> tcpMd5SigAddresses() {
        return tcpMd5SigAddresses;
    }

    void setTcpMd5Sig(Map<InetAddress, byte[]> keys) throws IOException {
        // Add synchronized as newTcpMp5Sigs might do multiple operations on the socket itself.
        synchronized (this) {
            tcpMd5SigAddresses = TcpMd5Util.newTcpMd5Sigs(this, tcpMd5SigAddresses, keys);
        }
    }
}

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free