Home / Function/ channelActive() — netty Function Reference

channelActive() — netty Function Reference

Architecture documentation for the channelActive() function in HexDumpProxyFrontendHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b686feee_4b89_df87_c94c_c0ccf70e36a4["channelActive()"]
  80e1dfc5_bd72_03a2_6186_6a50f3a5bb00["HexDumpProxyFrontendHandler"]
  b686feee_4b89_df87_c94c_c0ccf70e36a4 -->|defined in| 80e1dfc5_bd72_03a2_6186_6a50f3a5bb00
  style b686feee_4b89_df87_c94c_c0ccf70e36a4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java lines 41–62

    @Override
    public void channelActive(ChannelHandlerContext ctx) {
        final Channel inboundChannel = ctx.channel();

        // Start the connection attempt.
        Bootstrap b = new Bootstrap();
        b.group(inboundChannel.eventLoop())
         .channel(ctx.channel().getClass())
         .handler(new HexDumpProxyBackendHandler(inboundChannel))
         .option(ChannelOption.AUTO_READ, false);
        ChannelFuture f = b.connect(remoteHost, remotePort);
        outboundChannel = f.channel();
        f.addListener(future -> {
            if (future.isSuccess()) {
                // connection complete start to read first data
                inboundChannel.read();
            } else {
                // Close the connection if the connection attempt has failed.
                inboundChannel.close();
            }
        });
    }

Domain

Subdomains

Frequently Asked Questions

What does channelActive() do?
channelActive() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java.
Where is channelActive() defined?
channelActive() is defined in example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java at line 41.

Analyze Your Own Codebase

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

Try Supermodel Free