Home / Class/ Http2Server Class — netty Architecture

Http2Server Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  894d1994_c3df_cfd6_4c80_c119e22510fd["Http2Server"]
  3507e1f9_e207_6a2d_f4f1_75cb26cefb04["Http2Server.java"]
  894d1994_c3df_cfd6_4c80_c119e22510fd -->|defined in| 3507e1f9_e207_6a2d_f4f1_75cb26cefb04
  0b7c76ee_e0bd_492b_d166_56d07f336cb6["Http2Server()"]
  894d1994_c3df_cfd6_4c80_c119e22510fd -->|method| 0b7c76ee_e0bd_492b_d166_56d07f336cb6
  17f21b61_4549_11b5_33e6_2ce98dbae059["run()"]
  894d1994_c3df_cfd6_4c80_c119e22510fd -->|method| 17f21b61_4549_11b5_33e6_2ce98dbae059
  64bc95f4_08ad_a565_5889_c64376107946["main()"]
  894d1994_c3df_cfd6_4c80_c119e22510fd -->|method| 64bc95f4_08ad_a565_5889_c64376107946

Relationship Graph

Source Code

testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2Server.java lines 33–69

public final class Http2Server {

    private final int port;

    Http2Server(final int port) {
        this.port = port;
    }

    void run() throws Exception {
        // Configure the server.
        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        try {
            ServerBootstrap b = new ServerBootstrap();
            b.option(ChannelOption.SO_BACKLOG, 1024);
            b.group(group)
                    .channel(NioServerSocketChannel.class)
                    .handler(new LoggingHandler(LogLevel.INFO))
                    .childHandler(new Http2ServerInitializer());

            Channel ch = b.bind(port).sync().channel();

            ch.closeFuture().sync();
        } finally {
            group.shutdownGracefully();
        }
    }

    public static void main(String[] args) throws Exception {
        int port;
        if (args.length > 0) {
            port = Integer.parseInt(args[0]);
        } else {
            port = 9000;
        }
        new Http2Server(port).run();
    }
}

Frequently Asked Questions

What is the Http2Server class?
Http2Server is a class in the netty codebase, defined in testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2Server.java.
Where is Http2Server defined?
Http2Server is defined in testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2Server.java at line 33.

Analyze Your Own Codebase

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

Try Supermodel Free