Home / Function/ main() — netty Function Reference

main() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  dd01f289_6a13_e4e4_deac_99962881a2a2["main()"]
  6d8b175f_1755_1cfd_f6e0_8612f6bbeede["StompClient"]
  dd01f289_6a13_e4e4_deac_99962881a2a2 -->|defined in| 6d8b175f_1755_1cfd_f6e0_8612f6bbeede
  style dd01f289_6a13_e4e4_deac_99962881a2a2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/stomp/StompClient.java lines 44–64

    public static void main(String[] args) throws Exception {
        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        try {
            Bootstrap b = new Bootstrap();
            b.group(group).channel(NioSocketChannel.class);
            b.handler(new ChannelInitializer<SocketChannel>() {
                @Override
                protected void initChannel(SocketChannel ch) throws Exception {
                    ChannelPipeline pipeline = ch.pipeline();
                    pipeline.addLast("decoder", new StompSubframeDecoder());
                    pipeline.addLast("encoder", new StompSubframeEncoder());
                    pipeline.addLast("aggregator", new StompSubframeAggregator(1048576));
                    pipeline.addLast("handler", new StompClientHandler());
                }
            });

            b.connect(HOST, 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/stomp/StompClient.java.
Where is main() defined?
main() is defined in example/src/main/java/io/netty/example/stomp/StompClient.java at line 44.

Analyze Your Own Codebase

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

Try Supermodel Free