Home / Function/ http2ExceptionInPipelineShouldCloseConnection() — netty Function Reference

http2ExceptionInPipelineShouldCloseConnection() — netty Function Reference

Architecture documentation for the http2ExceptionInPipelineShouldCloseConnection() function in Http2ConnectionRoundtripTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  8d8c4f92_bb67_e117_1fa5_19301fa22d7d["http2ExceptionInPipelineShouldCloseConnection()"]
  0d6189e8_c033_39ff_d087_9019351440fe["Http2ConnectionRoundtripTest"]
  8d8c4f92_bb67_e117_1fa5_19301fa22d7d -->|defined in| 0d6189e8_c033_39ff_d087_9019351440fe
  1dd685b8_9b56_5b35_70ca_7f2bf9016254["bootstrapEnv()"]
  8d8c4f92_bb67_e117_1fa5_19301fa22d7d -->|calls| 1dd685b8_9b56_5b35_70ca_7f2bf9016254
  style 8d8c4f92_bb67_e117_1fa5_19301fa22d7d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java lines 569–603

    @Test
    public void http2ExceptionInPipelineShouldCloseConnection() throws Exception {
        bootstrapEnv(1, 1, 2, 1);

        // Create a latch to track when the close occurs.
        final CountDownLatch closeLatch = new CountDownLatch(1);
        clientChannel.closeFuture().addListener(future -> closeLatch.countDown());

        // Create a single stream by sending a HEADERS frame to the server.
        final Http2Headers headers = dummyHeaders();
        runInChannel(clientChannel, new Http2Runnable() {
            @Override
            public void run() throws Http2Exception {
                http2Client.encoder().writeHeaders(ctx(), 3, headers, 0, (short) 16, false, 0, false,
                        newPromise());
                http2Client.flush(ctx());
            }
        });

        // Wait for the server to create the stream.
        assertTrue(serverSettingsAckLatch.await(DEFAULT_AWAIT_TIMEOUT_SECONDS, SECONDS));
        assertTrue(requestLatch.await(DEFAULT_AWAIT_TIMEOUT_SECONDS, SECONDS));

        // Add a handler that will immediately throw an exception.
        clientChannel.pipeline().addFirst(new ChannelHandlerAdapter() {
            @Override
            public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
                throw Http2Exception.connectionError(PROTOCOL_ERROR, "Fake Exception");
            }
        });

        // Wait for the close to occur.
        assertTrue(closeLatch.await(DEFAULT_AWAIT_TIMEOUT_SECONDS, SECONDS));
        assertFalse(clientChannel.isOpen());
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free