Home / Function/ channelReadShouldRespectAutoReadAndNotProduceNPE() — netty Function Reference

channelReadShouldRespectAutoReadAndNotProduceNPE() — netty Function Reference

Architecture documentation for the channelReadShouldRespectAutoReadAndNotProduceNPE() function in Http2MultiplexTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b792f3c1_9e77_d261_9c46_b134d596e00d["channelReadShouldRespectAutoReadAndNotProduceNPE()"]
  4745ff96_ed57_3bd8_9861_4b786d0b6e09["Http2MultiplexTest"]
  b792f3c1_9e77_d261_9c46_b134d596e00d -->|defined in| 4745ff96_ed57_3bd8_9861_4b786d0b6e09
  8df7745b_db2d_ef92_4b30_080373ca9f6d["verifyFramesMultiplexedToCorrectChannel()"]
  b792f3c1_9e77_d261_9c46_b134d596e00d -->|calls| 8df7745b_db2d_ef92_4b30_080373ca9f6d
  style b792f3c1_9e77_d261_9c46_b134d596e00d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java lines 653–687

    @Test
    public void channelReadShouldRespectAutoReadAndNotProduceNPE() throws Exception {
        LastInboundHandler inboundHandler = new LastInboundHandler();
        Http2StreamChannel childChannel = newInboundStream(3, false, inboundHandler);
        assertTrue(childChannel.config().isAutoRead());
        Http2HeadersFrame headersFrame = inboundHandler.readInbound();
        assertNotNull(headersFrame);

        childChannel.config().setAutoRead(false);
        childChannel.pipeline().addFirst(new ChannelInboundHandlerAdapter() {
            private int count;
            @Override
            public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
                ctx.fireChannelRead(msg);
                // Close channel after 2 reads so there is still something in the inboundBuffer when the close happens.
                if (++count == 2) {
                    ctx.close();
                }
            }
        });
        frameInboundWriter.writeInboundData(childChannel.stream().id(), bb("hello world"), 0, false);
        Http2DataFrame dataFrame0 = inboundHandler.readInbound();
        assertNotNull(dataFrame0);
        release(dataFrame0);

        frameInboundWriter.writeInboundData(childChannel.stream().id(), bb("foo"), 0, false);
        frameInboundWriter.writeInboundData(childChannel.stream().id(), bb("bar"), 0, false);
        frameInboundWriter.writeInboundData(childChannel.stream().id(), bb("bar"), 0, false);

        assertNull(inboundHandler.readInbound());

        childChannel.config().setAutoRead(true);
        verifyFramesMultiplexedToCorrectChannel(childChannel, inboundHandler, 3);
        inboundHandler.checkException();
    }

Domain

Subdomains

Frequently Asked Questions

What does channelReadShouldRespectAutoReadAndNotProduceNPE() do?
channelReadShouldRespectAutoReadAndNotProduceNPE() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java.
Where is channelReadShouldRespectAutoReadAndNotProduceNPE() defined?
channelReadShouldRespectAutoReadAndNotProduceNPE() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java at line 653.
What does channelReadShouldRespectAutoReadAndNotProduceNPE() call?
channelReadShouldRespectAutoReadAndNotProduceNPE() calls 1 function(s): verifyFramesMultiplexedToCorrectChannel.

Analyze Your Own Codebase

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

Try Supermodel Free