Home / Function/ initChannel() — netty Function Reference

initChannel() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  81ce779d_4a49_db46_1b93_56ff43b06d33["initChannel()"]
  3bcbc9a3_7e36_78f9_4c6a_7d6135ad0448["FactorialServerInitializer"]
  81ce779d_4a49_db46_1b93_56ff43b06d33 -->|defined in| 3bcbc9a3_7e36_78f9_4c6a_7d6135ad0448
  style 81ce779d_4a49_db46_1b93_56ff43b06d33 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/factorial/FactorialServerInitializer.java lines 38–58

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

        if (sslCtx != null) {
            pipeline.addLast(sslCtx.newHandler(ch.alloc()));
        }

        // Enable stream compression (you can remove these two if unnecessary)
        pipeline.addLast(ZlibCodecFactory.newZlibEncoder(ZlibWrapper.GZIP));
        pipeline.addLast(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP, MAX_CONTENT_LENGTH));

        // Add the number codec first,
        pipeline.addLast(new BigIntegerDecoder());
        pipeline.addLast(new NumberEncoder());

        // and then business logic.
        // Please note we create a handler for every new channel
        // because it has stateful properties.
        pipeline.addLast(new FactorialServerHandler());
    }

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

Analyze Your Own Codebase

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

Try Supermodel Free