Home / Function/ channelRead0() — netty Function Reference

channelRead0() — netty Function Reference

Architecture documentation for the channelRead0() function in SocketStringEchoTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0c8fe149_f08d_8564_0083_8ba17d525735["channelRead0()"]
  909b0e90_0599_acbc_32f0_551a36a80b00["StringEchoHandler"]
  0c8fe149_f08d_8564_0083_8ba17d525735 -->|defined in| 909b0e90_0599_acbc_32f0_551a36a80b00
  style 0c8fe149_f08d_8564_0083_8ba17d525735 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketStringEchoTest.java lines 168–184

        @Override
        public void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
            if (!data[dataIndex].equals(msg)) {
                donePromise.tryFailure(new IllegalStateException("index: " + dataIndex + " didn't match!"));
                ctx.close();
                return;
            }

            if (channel.parent() != null) {
                String delimiter = random.nextBoolean() ? "\r\n" : "\n";
                channel.write(msg + delimiter);
            }

            if (++dataIndex >= data.length) {
                donePromise.setSuccess(null);
            }
        }

Domain

Subdomains

Frequently Asked Questions

What does channelRead0() do?
channelRead0() is a function in the netty codebase, defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketStringEchoTest.java.
Where is channelRead0() defined?
channelRead0() is defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketStringEchoTest.java at line 168.

Analyze Your Own Codebase

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

Try Supermodel Free