Home / Function/ channelActive() — netty Function Reference

channelActive() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e10e4eef_7517_beb9_006a_70828f05ea78["channelActive()"]
  75d25e1f_d173_eba1_2e00_bdb589050562["AutoCloseFalseLeader"]
  e10e4eef_7517_beb9_006a_70828f05ea78 -->|defined in| 75d25e1f_d173_eba1_2e00_bdb589050562
  0257caf2_49bb_c678_4b3a_f599308c0f78["allDataReadEventTriggeredAfterHalfClosure()"]
  0257caf2_49bb_c678_4b3a_f599308c0f78 -->|calls| e10e4eef_7517_beb9_006a_70828f05ea78
  934e12c4_7f18_ee29_20df_e86d96a84c00["testHalfClosureReceiveDataOnFinalWait2StateWhenSoLingerSet()"]
  934e12c4_7f18_ee29_20df_e86d96a84c00 -->|calls| e10e4eef_7517_beb9_006a_70828f05ea78
  71714971_050a_f2f7_0fcc_c7f3afe1077f["testHalfClosureOnlyOneEventWhenAutoRead()"]
  71714971_050a_f2f7_0fcc_c7f3afe1077f -->|calls| e10e4eef_7517_beb9_006a_70828f05ea78
  400c4529_5b5e_12a2_fbf3_476c13dd093d["testAllDataReadAfterHalfClosure()"]
  400c4529_5b5e_12a2_fbf3_476c13dd093d -->|calls| e10e4eef_7517_beb9_006a_70828f05ea78
  4a2ffbbc_84a4_f186_7637_0f13afdf125d["testAllDataReadClosure()"]
  4a2ffbbc_84a4_f186_7637_0f13afdf125d -->|calls| e10e4eef_7517_beb9_006a_70828f05ea78
  style e10e4eef_7517_beb9_006a_70828f05ea78 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java lines 620–637

        @Override
        public void channelActive(ChannelHandlerContext ctx) throws Exception {
            ByteBuf buf = ctx.alloc().buffer(expectedBytes);
            buf.writerIndex(buf.writerIndex() + expectedBytes);
            ctx.writeAndFlush(buf.retainedDuplicate());

            // We wait here to ensure that we write before we have a chance to process the outbound
            // shutdown event.
            followerCloseLatch.await();

            // This write should fail, but we should still be allowed to read the peer's data
            ctx.writeAndFlush(buf).addListener(future -> {
                if (future.cause() == null) {
                    causeRef.set(new IllegalStateException("second write should have failed!"));
                    doneLatch.countDown();
                }
            });
        }

Domain

Subdomains

Frequently Asked Questions

What does channelActive() do?
channelActive() is a function in the netty codebase, defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java.
Where is channelActive() defined?
channelActive() is defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java at line 620.
What calls channelActive()?
channelActive() is called by 5 function(s): allDataReadEventTriggeredAfterHalfClosure, testAllDataReadAfterHalfClosure, testAllDataReadClosure, testHalfClosureOnlyOneEventWhenAutoRead, testHalfClosureReceiveDataOnFinalWait2StateWhenSoLingerSet.

Analyze Your Own Codebase

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

Try Supermodel Free