Home / Function/ main() — netty Function Reference

main() — netty Function Reference

Architecture documentation for the main() function in HttpHelloWorldServer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0e6a82f4_f397_b7b0_efef_6559f4459ead["main()"]
  500d472a_27cc_13c2_b991_f973707309a4["HttpHelloWorldServer"]
  0e6a82f4_f397_b7b0_efef_6559f4459ead -->|defined in| 500d472a_27cc_13c2_b991_f973707309a4
  style 0e6a82f4_f397_b7b0_efef_6559f4459ead fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/http/helloworld/HttpHelloWorldServer.java lines 39–62

    public static void main(String[] args) throws Exception {
        // Configure SSL.
        final SslContext sslCtx = ServerUtil.buildSslContext();

        // 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 HttpHelloWorldServerInitializer(sslCtx));

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

            System.err.println("Open your web browser and navigate to " +
                    (SSL? "https" : "http") + "://127.0.0.1:" + PORT + '/');

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

Domain

Subdomains

Frequently Asked Questions

What does main() do?
main() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/http/helloworld/HttpHelloWorldServer.java.
Where is main() defined?
main() is defined in example/src/main/java/io/netty/example/http/helloworld/HttpHelloWorldServer.java at line 39.

Analyze Your Own Codebase

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

Try Supermodel Free