Home / Function/ run() — netty Function Reference

run() — netty Function Reference

Architecture documentation for the run() function in MsgEchoPeerBase.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  772bff63_778a_5822_e434_0b19d0126caf["run()"]
  d0ce01df_1bcc_da19_1b31_1f7034da24e0["MsgEchoPeerBase"]
  772bff63_778a_5822_e434_0b19d0126caf -->|defined in| d0ce01df_1bcc_da19_1b31_1f7034da24e0
  style 772bff63_778a_5822_e434_0b19d0126caf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/udt/echo/rendezvous/MsgEchoPeerBase.java lines 51–77

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

Domain

Subdomains

Frequently Asked Questions

What does run() do?
run() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/udt/echo/rendezvous/MsgEchoPeerBase.java.
Where is run() defined?
run() is defined in example/src/main/java/io/netty/example/udt/echo/rendezvous/MsgEchoPeerBase.java at line 51.

Analyze Your Own Codebase

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

Try Supermodel Free