Home / Function/ udpExceptionCaught() — netty Function Reference

udpExceptionCaught() — netty Function Reference

Architecture documentation for the udpExceptionCaught() function in PcapWriteHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b8414409_f89e_9b3b_823d_1bca832e5e0c["udpExceptionCaught()"]
  e9f4993c_4935_9405_4fab_0bbc9030a673["PcapWriteHandlerTest"]
  b8414409_f89e_9b3b_823d_1bca832e5e0c -->|defined in| e9f4993c_4935_9405_4fab_0bbc9030a673
  201e7e9e_c23c_b328_ecb1_117026fc1c03["InetSocketAddress()"]
  b8414409_f89e_9b3b_823d_1bca832e5e0c -->|calls| 201e7e9e_c23c_b328_ecb1_117026fc1c03
  5c425ce6_e952_d363_e0ef_0934a41b930a["EmbeddedDatagramChannel()"]
  b8414409_f89e_9b3b_823d_1bca832e5e0c -->|calls| 5c425ce6_e952_d363_e0ef_0934a41b930a
  style b8414409_f89e_9b3b_823d_1bca832e5e0c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/pcap/PcapWriteHandlerTest.java lines 425–458

    @Test
    public void udpExceptionCaught() {
        final ByteBuf pcapBuffer = Unpooled.buffer();
        try {
            final RuntimeException exception = new RuntimeException();

            InetSocketAddress serverAddr = new InetSocketAddress("1.1.1.1", 1234);
            InetSocketAddress clientAddr = new InetSocketAddress("2.2.2.2", 3456);

            CloseDetectingByteBufOutputStream outputStream = new CloseDetectingByteBufOutputStream(pcapBuffer);
            // We fake a client
            EmbeddedChannel embeddedChannel = new EmbeddedDatagramChannel(clientAddr, serverAddr);
            embeddedChannel.pipeline().addLast(PcapWriteHandler.builder()
                    .build(outputStream));
            embeddedChannel.pipeline().fireExceptionCaught(exception);

            assertTrue(outputStream.closeCalled());

            // Verify only the PCAP global header was written.
            assertEquals(24, pcapBuffer.readableBytes());

            // Verify thrown exception
            try {
                embeddedChannel.checkException();
                fail();
            } catch (Throwable t) {
                assertSame(exception, t);
            }

            assertFalse(embeddedChannel.finishAndReleaseAll());
        } finally {
            pcapBuffer.release();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does udpExceptionCaught() do?
udpExceptionCaught() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/pcap/PcapWriteHandlerTest.java.
Where is udpExceptionCaught() defined?
udpExceptionCaught() is defined in handler/src/test/java/io/netty/handler/pcap/PcapWriteHandlerTest.java at line 425.
What does udpExceptionCaught() call?
udpExceptionCaught() calls 2 function(s): EmbeddedDatagramChannel, InetSocketAddress.

Analyze Your Own Codebase

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

Try Supermodel Free