Home / Function/ embeddedUdp() — netty Function Reference

embeddedUdp() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ddfde28c_4e8f_f8cd_23bf_3a4fb181fa91["embeddedUdp()"]
  e9f4993c_4935_9405_4fab_0bbc9030a673["PcapWriteHandlerTest"]
  ddfde28c_4e8f_f8cd_23bf_3a4fb181fa91 -->|defined in| e9f4993c_4935_9405_4fab_0bbc9030a673
  201e7e9e_c23c_b328_ecb1_117026fc1c03["InetSocketAddress()"]
  ddfde28c_4e8f_f8cd_23bf_3a4fb181fa91 -->|calls| 201e7e9e_c23c_b328_ecb1_117026fc1c03
  eb1ea467_0963_a158_64e4_4642e02fe449["verifyUdpCapture()"]
  ddfde28c_4e8f_f8cd_23bf_3a4fb181fa91 -->|calls| eb1ea467_0963_a158_64e4_4642e02fe449
  style ddfde28c_4e8f_f8cd_23bf_3a4fb181fa91 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/pcap/PcapWriteHandlerTest.java lines 151–187

    @Test
    public void embeddedUdp() {
        final ByteBuf pcapBuffer = Unpooled.buffer();
        final ByteBuf payload = Unpooled.wrappedBuffer("Meow".getBytes());

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

            // We fake a client
            EmbeddedChannel embeddedChannel = new EmbeddedChannel(
                    PcapWriteHandler.builder()
                            .forceUdpChannel(clientAddr, serverAddr)
                            .build(new ByteBufOutputStream(pcapBuffer))
            );

            assertTrue(embeddedChannel.writeOutbound(payload.retainedDuplicate()));
            ByteBuf read = embeddedChannel.readOutbound();
            assertEquals(payload, read);
            read.release();

            assertTrue(embeddedChannel.writeInbound(payload.retainedDuplicate()));
            read = embeddedChannel.readInbound();
            assertEquals(payload, read);
            read.release();

            // Verify the capture data
            verifyUdpCapture(true, pcapBuffer, payload, serverAddr, clientAddr);

            verifyUdpCapture(false, pcapBuffer, payload, clientAddr, serverAddr);

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

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free