Home / Function/ testServerCloseChannelSameEventLoop() — netty Function Reference

testServerCloseChannelSameEventLoop() — netty Function Reference

Architecture documentation for the testServerCloseChannelSameEventLoop() function in LocalChannelTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  30a21170_6dc0_5378_0750_a03c460fb9fb["testServerCloseChannelSameEventLoop()"]
  d7e5442a_9b99_814d_2bd6_0be57237db65["LocalChannelTest"]
  30a21170_6dc0_5378_0750_a03c460fb9fb -->|defined in| d7e5442a_9b99_814d_2bd6_0be57237db65
  d3c8aa54_ac5d_6944_e789_c2c22ce16089["closeChannel()"]
  30a21170_6dc0_5378_0750_a03c460fb9fb -->|calls| d3c8aa54_ac5d_6944_e789_c2c22ce16089
  style 30a21170_6dc0_5378_0750_a03c460fb9fb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/local/LocalChannelTest.java lines 195–229

    @Test
    public void testServerCloseChannelSameEventLoop() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        ServerBootstrap sb = new ServerBootstrap()
                .group(group2)
                .channel(LocalServerChannel.class)
                .childHandler(new SimpleChannelInboundHandler<Object>() {
                    @Override
                    protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
                        ctx.close();
                        latch.countDown();
                    }
                });
        Channel sc = null;
        Channel cc = null;
        try {
            sc = sb.bind(TEST_ADDRESS).sync().channel();

            Bootstrap b = new Bootstrap()
                    .group(group2)
                    .channel(LocalChannel.class)
                    .handler(new SimpleChannelInboundHandler<Object>() {
                        @Override
                        protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
                            // discard
                        }
                    });
            cc = b.connect(sc.localAddress()).sync().channel();
            cc.writeAndFlush(new Object());
            assertTrue(latch.await(5, SECONDS));
        } finally {
            closeChannel(cc);
            closeChannel(sc);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testServerCloseChannelSameEventLoop() do?
testServerCloseChannelSameEventLoop() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/local/LocalChannelTest.java.
Where is testServerCloseChannelSameEventLoop() defined?
testServerCloseChannelSameEventLoop() is defined in transport/src/test/java/io/netty/channel/local/LocalChannelTest.java at line 195.
What does testServerCloseChannelSameEventLoop() call?
testServerCloseChannelSameEventLoop() calls 1 function(s): closeChannel.

Analyze Your Own Codebase

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

Try Supermodel Free