Home / Function/ main() — netty Function Reference

main() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  45db7b0d_4f13_5111_3fce_d718918e8cef["main()"]
  c654e8a2_cbeb_5bae_4d48_18ae9fbb5221["HttpCorsServer"]
  45db7b0d_4f13_5111_3fce_d718918e8cef -->|defined in| c654e8a2_cbeb_5bae_4d48_18ae9fbb5221
  style 45db7b0d_4f13_5111_3fce_d718918e8cef fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/http/cors/HttpCorsServer.java lines 79–95

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

        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        try {
            ServerBootstrap b = new ServerBootstrap();
            b.group(group)
             .channel(NioServerSocketChannel.class)
             .handler(new LoggingHandler(LogLevel.INFO))
             .childHandler(new HttpCorsServerInitializer(sslCtx));

            b.bind(PORT).sync().channel().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/cors/HttpCorsServer.java.
Where is main() defined?
main() is defined in example/src/main/java/io/netty/example/http/cors/HttpCorsServer.java at line 79.

Analyze Your Own Codebase

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

Try Supermodel Free