Home / Function/ initChannel() — netty Function Reference

initChannel() — netty Function Reference

Architecture documentation for the initChannel() function in Http2ClientFrameInitializer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  76fab784_7e86_b71f_c0be_567bb71cf135["initChannel()"]
  6149efff_ed30_8b1e_9fcc_86681694a1e5["Http2ClientFrameInitializer"]
  76fab784_7e86_b71f_c0be_567bb71cf135 -->|defined in| 6149efff_ed30_8b1e_9fcc_86681694a1e5
  style 76fab784_7e86_b71f_c0be_567bb71cf135 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/http2/helloworld/frame/client/Http2ClientFrameInitializer.java lines 38–55

    @Override
    protected void initChannel(Channel ch) throws Exception {
        // ensure that our 'trust all' SSL handler is the first in the pipeline if SSL is enabled.
        if (sslCtx != null) {
            ch.pipeline().addFirst(sslCtx.newHandler(ch.alloc()));
        }

        final Http2FrameCodec http2FrameCodec = Http2FrameCodecBuilder.forClient()
            .initialSettings(Http2Settings.defaultSettings()) // this is the default, but shows it can be changed.
            .build();
        ch.pipeline().addLast(http2FrameCodec);
        ch.pipeline().addLast(new Http2MultiplexHandler(new SimpleChannelInboundHandler() {
            @Override
            protected void channelRead0(ChannelHandlerContext ctx, Object msg) {
                // NOOP (this is the handler for 'inbound' streams, which is not relevant in this example)
            }
        }));
    }

Domain

Subdomains

Frequently Asked Questions

What does initChannel() do?
initChannel() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/http2/helloworld/frame/client/Http2ClientFrameInitializer.java.
Where is initChannel() defined?
initChannel() is defined in example/src/main/java/io/netty/example/http2/helloworld/frame/client/Http2ClientFrameInitializer.java at line 38.

Analyze Your Own Codebase

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

Try Supermodel Free