Home / Function/ channelRead0() — netty Function Reference

channelRead0() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  77167c82_4a98_5027_d91f_914fdf82f922["channelRead0()"]
  ad2c2edf_e4a1_2675_364b_725729ad332a["SecureChatServerHandler"]
  77167c82_4a98_5027_d91f_914fdf82f922 -->|defined in| ad2c2edf_e4a1_2675_364b_725729ad332a
  style 77167c82_4a98_5027_d91f_914fdf82f922 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/securechat/SecureChatServerHandler.java lines 51–66

    @Override
    public void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
        // Send the received message to all channels but the current one.
        for (Channel c: channels) {
            if (c != ctx.channel()) {
                c.writeAndFlush("[" + ctx.channel().remoteAddress() + "] " + msg + '\n');
            } else {
                c.writeAndFlush("[you] " + msg + '\n');
            }
        }

        // Close the connection if the client has sent 'bye'.
        if ("bye".equals(msg.toLowerCase())) {
            ctx.close();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does channelRead0() do?
channelRead0() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/securechat/SecureChatServerHandler.java.
Where is channelRead0() defined?
channelRead0() is defined in example/src/main/java/io/netty/example/securechat/SecureChatServerHandler.java at line 51.

Analyze Your Own Codebase

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

Try Supermodel Free