Home / Function/ channelRead() — netty Function Reference

channelRead() — netty Function Reference

Architecture documentation for the channelRead() function in ServerBootstrap.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  62382788_d26c_b56b_2499_06e1b104f9c3["channelRead()"]
  f32a5269_a3d9_354a_3815_e297ee3f3e29["ServerBootstrapAcceptor"]
  62382788_d26c_b56b_2499_06e1b104f9c3 -->|defined in| f32a5269_a3d9_354a_3815_e297ee3f3e29
  0b873b52_fd29_cffc_2068_8b007dde392f["forceClose()"]
  62382788_d26c_b56b_2499_06e1b104f9c3 -->|calls| 0b873b52_fd29_cffc_2068_8b007dde392f
  style 62382788_d26c_b56b_2499_06e1b104f9c3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java lines 221–255

        @Override
        @SuppressWarnings("unchecked")
        public void channelRead(ChannelHandlerContext ctx, Object msg) {
            final Channel child = (Channel) msg;

            child.pipeline().addLast(childHandler);

            try {
                setChannelOptions(child, childOptions, logger);
            } catch (Throwable cause) {
                forceClose(child, cause);
                return;
            }
            setAttributes(child, childAttrs);

            if (!extensions.isEmpty()) {
                for (ChannelInitializerExtension extension : extensions) {
                    try {
                        extension.postInitializeServerChildChannel(child);
                    } catch (Exception e) {
                        logger.warn("Exception thrown from postInitializeServerChildChannel", e);
                    }
                }
            }

            try {
                childGroup.register(child).addListener(future -> {
                    if (!future.isSuccess()) {
                        forceClose(child, future.cause());
                    }
                });
            } catch (Throwable t) {
                forceClose(child, t);
            }
        }

Domain

Subdomains

Calls

Frequently Asked Questions

What does channelRead() do?
channelRead() is a function in the netty codebase, defined in transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java.
Where is channelRead() defined?
channelRead() is defined in transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java at line 221.
What does channelRead() call?
channelRead() calls 1 function(s): forceClose.

Analyze Your Own Codebase

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

Try Supermodel Free