Home / Function/ initChannel() — netty Function Reference

initChannel() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8d5fde3e_a114_594d_a74e_3ef3a28714f2["initChannel()"]
  d3f17d8c_a3f5_b8d7_e3b2_7be21f8afe16["SecureChatServerInitializer"]
  8d5fde3e_a114_594d_a74e_3ef3a28714f2 -->|defined in| d3f17d8c_a3f5_b8d7_e3b2_7be21f8afe16
  style 8d5fde3e_a114_594d_a74e_3ef3a28714f2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/securechat/SecureChatServerInitializer.java lines 38–56

    @Override
    public void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();

        // Add SSL handler first to encrypt and decrypt everything.
        // In this example, we use a bogus certificate in the server side
        // and accept any invalid certificates in the client side.
        // You will need something more complicated to identify both
        // and server in the real world.
        pipeline.addLast(sslCtx.newHandler(ch.alloc()));

        // On top of the SSL handler, add the text line codec.
        pipeline.addLast(new DelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter()));
        pipeline.addLast(new StringDecoder());
        pipeline.addLast(new StringEncoder());

        // and then business logic.
        pipeline.addLast(new SecureChatServerHandler());
    }

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/securechat/SecureChatServerInitializer.java.
Where is initChannel() defined?
initChannel() is defined in example/src/main/java/io/netty/example/securechat/SecureChatServerInitializer.java at line 38.

Analyze Your Own Codebase

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

Try Supermodel Free