Home / Function/ main() — netty Function Reference

main() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  4fbb0d63_5455_558f_663d_d92f4e1cc7f5["main()"]
  a0d46673_bea7_5122_828a_1fd89864fe45["SctpEchoServer"]
  4fbb0d63_5455_558f_663d_d92f4e1cc7f5 -->|defined in| a0d46673_bea7_5122_828a_1fd89864fe45
  style 4fbb0d63_5455_558f_663d_d92f4e1cc7f5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/sctp/SctpEchoServer.java lines 37–65

    public static void main(String[] args) throws Exception {
        // Configure the server.
        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        final SctpEchoServerHandler serverHandler = new SctpEchoServerHandler();
        try {
            ServerBootstrap b = new ServerBootstrap();
            b.group(group)
             .channel(NioSctpServerChannel.class)
             .option(ChannelOption.SO_BACKLOG, 100)
             .handler(new LoggingHandler(LogLevel.INFO))
             .childHandler(new ChannelInitializer<SctpChannel>() {
                 @Override
                 public void initChannel(SctpChannel ch) throws Exception {
                     ch.pipeline().addLast(
                             //new LoggingHandler(LogLevel.INFO),
                             serverHandler);
                 }
             });

            // Start the server.
            ChannelFuture f = b.bind(PORT).sync();

            // Wait until the server socket is closed.
            f.channel().closeFuture().sync();
        } finally {
            // Shut down all event loops to terminate all threads.
            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/sctp/SctpEchoServer.java.
Where is main() defined?
main() is defined in example/src/main/java/io/netty/example/sctp/SctpEchoServer.java at line 37.

Analyze Your Own Codebase

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

Try Supermodel Free