Home / Function/ channelActive() — netty Function Reference

channelActive() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

example/src/main/java/io/netty/example/securechat/SecureChatServerHandler.java lines 35–49

    @Override
    public void channelActive(final ChannelHandlerContext ctx) {
        // Once session is secured, send a greeting and register the channel to the global channel
        // list so the channel received the messages from others.
        ctx.pipeline().get(SslHandler.class).handshakeFuture().addListener(future -> {
                    ctx.writeAndFlush(
                            "Welcome to secure chat service!\n");
                    ctx.writeAndFlush(
                            "Your session is protected by " +
                                    ctx.pipeline().get(SslHandler.class).engine().getSession().getCipherSuite() +
                                    " cipher suite.\n");

                    channels.add(ctx.channel());
                });
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free