Home / Function/ connectionWindowShouldAdjustWithMultipleStreams() — netty Function Reference

connectionWindowShouldAdjustWithMultipleStreams() — netty Function Reference

Architecture documentation for the connectionWindowShouldAdjustWithMultipleStreams() function in DefaultHttp2LocalFlowControllerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f1878823_7e30_9415_37ae_9ab2d65269b9["connectionWindowShouldAdjustWithMultipleStreams()"]
  99976e08_de48_4e06_40e5_5ee3655f2651["DefaultHttp2LocalFlowControllerTest"]
  f1878823_7e30_9415_37ae_9ab2d65269b9 -->|defined in| 99976e08_de48_4e06_40e5_5ee3655f2651
  7909b4ee_a611_4e8b_f2d5_96e89a175713["window()"]
  f1878823_7e30_9415_37ae_9ab2d65269b9 -->|calls| 7909b4ee_a611_4e8b_f2d5_96e89a175713
  62113048_84a9_1cf9_75f0_0ef0f3788315["receiveFlowControlledFrame()"]
  f1878823_7e30_9415_37ae_9ab2d65269b9 -->|calls| 62113048_84a9_1cf9_75f0_0ef0f3788315
  0704ea53_57a1_5305_109e_c7f112548050["verifyWindowUpdateNotSent()"]
  f1878823_7e30_9415_37ae_9ab2d65269b9 -->|calls| 0704ea53_57a1_5305_109e_c7f112548050
  5afc6fae_8360_072c_1a3a_5b5aa174554d["consumeBytes()"]
  f1878823_7e30_9415_37ae_9ab2d65269b9 -->|calls| 5afc6fae_8360_072c_1a3a_5b5aa174554d
  edb012e8_f760_5fb6_314e_77a6bfaf20b0["verifyWindowUpdateSent()"]
  f1878823_7e30_9415_37ae_9ab2d65269b9 -->|calls| edb012e8_f760_5fb6_314e_77a6bfaf20b0
  style f1878823_7e30_9415_37ae_9ab2d65269b9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2LocalFlowControllerTest.java lines 252–298

    @Test
    public void connectionWindowShouldAdjustWithMultipleStreams() throws Http2Exception {
        int newStreamId = 3;
        connection.local().createStream(newStreamId, false);

        try {
            assertEquals(DEFAULT_WINDOW_SIZE, window(STREAM_ID));
            assertEquals(DEFAULT_WINDOW_SIZE, window(CONNECTION_STREAM_ID));

            // Test that both stream and connection window are updated (or not updated) together
            int data1 = (int) (DEFAULT_WINDOW_SIZE * DEFAULT_WINDOW_UPDATE_RATIO) + 1;
            receiveFlowControlledFrame(STREAM_ID, data1, 0, false);
            verifyWindowUpdateNotSent(STREAM_ID);
            verifyWindowUpdateNotSent(CONNECTION_STREAM_ID);
            assertEquals(DEFAULT_WINDOW_SIZE - data1, window(STREAM_ID));
            assertEquals(DEFAULT_WINDOW_SIZE - data1, window(CONNECTION_STREAM_ID));
            assertTrue(consumeBytes(STREAM_ID, data1));
            verifyWindowUpdateSent(STREAM_ID, data1);
            verifyWindowUpdateSent(CONNECTION_STREAM_ID, data1);

            reset(frameWriter);

            // Create a scenario where data is depleted from multiple streams, but not enough data
            // to generate a window update on those streams. The amount will be enough to generate
            // a window update for the connection stream.
            --data1;
            int data2 = data1 >> 1;
            receiveFlowControlledFrame(STREAM_ID, data1, 0, false);
            receiveFlowControlledFrame(newStreamId, data1, 0, false);
            verifyWindowUpdateNotSent(STREAM_ID);
            verifyWindowUpdateNotSent(newStreamId);
            verifyWindowUpdateNotSent(CONNECTION_STREAM_ID);
            assertEquals(DEFAULT_WINDOW_SIZE - data1, window(STREAM_ID));
            assertEquals(DEFAULT_WINDOW_SIZE - data1, window(newStreamId));
            assertEquals(DEFAULT_WINDOW_SIZE - (data1 << 1), window(CONNECTION_STREAM_ID));
            assertFalse(consumeBytes(STREAM_ID, data1));
            assertTrue(consumeBytes(newStreamId, data2));
            verifyWindowUpdateNotSent(STREAM_ID);
            verifyWindowUpdateNotSent(newStreamId);
            verifyWindowUpdateSent(CONNECTION_STREAM_ID, data1 + data2);
            assertEquals(DEFAULT_WINDOW_SIZE - data1, window(STREAM_ID));
            assertEquals(DEFAULT_WINDOW_SIZE - data1, window(newStreamId));
            assertEquals(DEFAULT_WINDOW_SIZE - (data1 - data2), window(CONNECTION_STREAM_ID));
        } finally {
            connection.stream(newStreamId).close();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does connectionWindowShouldAdjustWithMultipleStreams() do?
connectionWindowShouldAdjustWithMultipleStreams() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2LocalFlowControllerTest.java.
Where is connectionWindowShouldAdjustWithMultipleStreams() defined?
connectionWindowShouldAdjustWithMultipleStreams() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2LocalFlowControllerTest.java at line 252.
What does connectionWindowShouldAdjustWithMultipleStreams() call?
connectionWindowShouldAdjustWithMultipleStreams() calls 5 function(s): consumeBytes, receiveFlowControlledFrame, verifyWindowUpdateNotSent, verifyWindowUpdateSent, window.

Analyze Your Own Codebase

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

Try Supermodel Free