Home / Class/ MsgEchoClient Class — netty Architecture

MsgEchoClient Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  43784d71_222d_adcb_7e26_6a6b38111462["MsgEchoClient"]
  091409c8_45c5_1bf2_f246_ce44f81a7870["MsgEchoClient.java"]
  43784d71_222d_adcb_7e26_6a6b38111462 -->|defined in| 091409c8_45c5_1bf2_f246_ce44f81a7870
  bb9001b7_5680_3734_d378_d7ef6778f40a["main()"]
  43784d71_222d_adcb_7e26_6a6b38111462 -->|method| bb9001b7_5680_3734_d378_d7ef6778f40a

Relationship Graph

Source Code

example/src/main/java/io/netty/example/udt/echo/message/MsgEchoClient.java lines 41–77

public final class MsgEchoClient {

    private static final Logger log = Logger.getLogger(MsgEchoClient.class.getName());

    static final String HOST = System.getProperty("host", "127.0.0.1");
    static final int PORT = Integer.parseInt(System.getProperty("port", "8007"));
    static final int SIZE = Integer.parseInt(System.getProperty("size", "256"));

    public static void main(String[] args) throws Exception {

        // Configure the client.
        final ThreadFactory connectFactory = new DefaultThreadFactory("connect");
        final EventLoopGroup connectGroup = new MultiThreadIoEventLoopGroup(1,
                connectFactory, NioIoHandler.newFactory(NioUdtProvider.MESSAGE_PROVIDER));
        try {
            final Bootstrap boot = new Bootstrap();
            boot.group(connectGroup)
                    .channelFactory(NioUdtProvider.MESSAGE_CONNECTOR)
                    .handler(new ChannelInitializer<UdtChannel>() {
                        @Override
                        public void initChannel(final UdtChannel ch)
                                throws Exception {
                            ch.pipeline().addLast(
                                    new LoggingHandler(LogLevel.INFO),
                                    new MsgEchoClientHandler());
                        }
                    });
            // Start the client.
            final ChannelFuture f = boot.connect(HOST, PORT).sync();
            // Wait until the connection is closed.
            f.channel().closeFuture().sync();
        } finally {
            // Shut down the event loop to terminate all threads.
            connectGroup.shutdownGracefully();
        }
    }
}

Frequently Asked Questions

What is the MsgEchoClient class?
MsgEchoClient is a class in the netty codebase, defined in example/src/main/java/io/netty/example/udt/echo/message/MsgEchoClient.java.
Where is MsgEchoClient defined?
MsgEchoClient is defined in example/src/main/java/io/netty/example/udt/echo/message/MsgEchoClient.java at line 41.

Analyze Your Own Codebase

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

Try Supermodel Free