Home / Function/ clientCloseWithoutServerReadIsDetected0() — netty Function Reference

clientCloseWithoutServerReadIsDetected0() — netty Function Reference

Architecture documentation for the clientCloseWithoutServerReadIsDetected0() function in DetectPeerCloseWithoutReadTest.java from the netty codebase.

Function java Buffer Telemetry calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  0efd892e_d03e_c723_f8f6_7342d1497217["clientCloseWithoutServerReadIsDetected0()"]
  2f5040d4_a100_f0df_6a2f_a91790d5e155["DetectPeerCloseWithoutReadTest"]
  0efd892e_d03e_c723_f8f6_7342d1497217 -->|defined in| 2f5040d4_a100_f0df_6a2f_a91790d5e155
  ef5502f6_ac17_4996_5ba2_38dcddb080b1["clientCloseWithoutServerReadIsDetectedNoExtraReadRequested()"]
  ef5502f6_ac17_4996_5ba2_38dcddb080b1 -->|calls| 0efd892e_d03e_c723_f8f6_7342d1497217
  4b4a8926_b21b_82f9_ba0d_826e7716acd0["clientCloseWithoutServerReadIsDetectedExtraReadRequested()"]
  4b4a8926_b21b_82f9_ba0d_826e7716acd0 -->|calls| 0efd892e_d03e_c723_f8f6_7342d1497217
  ed700b6e_0993_6dc8_45c9_2a4304673802["serverChannel()"]
  0efd892e_d03e_c723_f8f6_7342d1497217 -->|calls| ed700b6e_0993_6dc8_45c9_2a4304673802
  7170367b_e17b_7820_cc1b_96844cf96015["TestHandler()"]
  0efd892e_d03e_c723_f8f6_7342d1497217 -->|calls| 7170367b_e17b_7820_cc1b_96844cf96015
  0b55ef73_d7cd_bc3e_deae_975707a22f28["clientChannel()"]
  0efd892e_d03e_c723_f8f6_7342d1497217 -->|calls| 0b55ef73_d7cd_bc3e_deae_975707a22f28
  style 0efd892e_d03e_c723_f8f6_7342d1497217 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/DetectPeerCloseWithoutReadTest.java lines 58–108

    private void clientCloseWithoutServerReadIsDetected0(final boolean extraReadRequested)
            throws InterruptedException {
        EventLoopGroup serverGroup = null;
        EventLoopGroup clientGroup = null;
        Channel serverChannel = null;
        try {
            final CountDownLatch latch = new CountDownLatch(1);
            final AtomicInteger bytesRead = new AtomicInteger();
            final int expectedBytes = 100;
            serverGroup = newGroup();
            clientGroup = newGroup();
            ServerBootstrap sb = new ServerBootstrap();
            sb.group(serverGroup);
            sb.channel(serverChannel());
            // Ensure we read only one message per read() call and that we need multiple read()
            // calls to consume everything.
            sb.childOption(ChannelOption.AUTO_READ, false);
            sb.childOption(ChannelOption.MAX_MESSAGES_PER_READ, 1);
            sb.childOption(ChannelOption.RECVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(expectedBytes / 10));
            sb.childHandler(new ChannelInitializer<Channel>() {
                @Override
                protected void initChannel(Channel ch) {
                    ch.pipeline().addLast(new TestHandler(bytesRead, extraReadRequested, latch));
                }
            });

            serverChannel = sb.bind(new InetSocketAddress(0)).syncUninterruptibly().channel();

            Bootstrap cb = new Bootstrap();
            cb.group(serverGroup);
            cb.channel(clientChannel());
            cb.handler(new ChannelInboundHandlerAdapter());
            Channel clientChannel = cb.connect(serverChannel.localAddress()).syncUninterruptibly().channel();
            ByteBuf buf = clientChannel.alloc().buffer(expectedBytes);
            buf.writerIndex(buf.writerIndex() + expectedBytes);
            clientChannel.writeAndFlush(buf).addListener(ChannelFutureListener.CLOSE);

            latch.await();
            assertEquals(expectedBytes, bytesRead.get());
        } finally {
            if (serverChannel != null) {
                serverChannel.close().syncUninterruptibly();
            }
            if (serverGroup != null) {
                serverGroup.shutdownGracefully();
            }
            if (clientGroup != null) {
                clientGroup.shutdownGracefully();
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does clientCloseWithoutServerReadIsDetected0() do?
clientCloseWithoutServerReadIsDetected0() is a function in the netty codebase, defined in transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/DetectPeerCloseWithoutReadTest.java.
Where is clientCloseWithoutServerReadIsDetected0() defined?
clientCloseWithoutServerReadIsDetected0() is defined in transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/DetectPeerCloseWithoutReadTest.java at line 58.
What does clientCloseWithoutServerReadIsDetected0() call?
clientCloseWithoutServerReadIsDetected0() calls 3 function(s): TestHandler, clientChannel, serverChannel.
What calls clientCloseWithoutServerReadIsDetected0()?
clientCloseWithoutServerReadIsDetected0() is called by 2 function(s): clientCloseWithoutServerReadIsDetectedExtraReadRequested, clientCloseWithoutServerReadIsDetectedNoExtraReadRequested.

Analyze Your Own Codebase

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

Try Supermodel Free