Home / Function/ reentrantClose() — netty Function Reference

reentrantClose() — netty Function Reference

Architecture documentation for the reentrantClose() function in HttpRequestDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  696229a9_f48f_be07_7922_261d2f4faa16["reentrantClose()"]
  514322d5_436a_d1ac_6240_1f9cf42934a4["HttpRequestDecoderTest"]
  696229a9_f48f_be07_7922_261d2f4faa16 -->|defined in| 514322d5_436a_d1ac_6240_1f9cf42934a4
  style 696229a9_f48f_be07_7922_261d2f4faa16 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java lines 828–863

    @Test
    void reentrantClose() {
        String requestStr = "GET / HTTP/1.1\r\n" +
                "Host: example.com\r\n" +
                "Content-Length: 0\r\n" +
                "\r\n" +
                "GET / HTTP/1.1\r\n" +
                "Host: example.com\r\n" +
                "Content-Length: 0\r\n" +
                "\r\n";
        EmbeddedChannel channel = new EmbeddedChannel(new HttpRequestDecoder(), new ChannelInboundHandlerAdapter() {
            private int i;

            @Override
            public void channelRead(ChannelHandlerContext ctx, Object msg) {
                if (i == 0) {
                    assertInstanceOf(HttpRequest.class, msg);
                } else if (i == 1) {
                    assertInstanceOf(LastHttpContent.class, msg);
                } else if (i == 2) {
                    assertInstanceOf(HttpRequest.class, msg);
                } else if (i == 3) {
                    assertInstanceOf(LastHttpContent.class, msg);
                }
                ReferenceCountUtil.release(msg);

                if (++i == 1) {
                    // first request
                    ctx.close();
                }
            }
        });

        assertFalse(channel.writeInbound(Unpooled.copiedBuffer(requestStr, CharsetUtil.US_ASCII)));
        assertFalse(channel.finish());
    }

Domain

Subdomains

Frequently Asked Questions

What does reentrantClose() do?
reentrantClose() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java.
Where is reentrantClose() defined?
reentrantClose() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java at line 828.

Analyze Your Own Codebase

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

Try Supermodel Free