Home / Class/ EpollDatagramScatteringReadTest Class — netty Architecture

EpollDatagramScatteringReadTest Class — netty Architecture

Architecture documentation for the EpollDatagramScatteringReadTest class in EpollDatagramScatteringReadTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  84cf7040_5cb1_94bd_4284_dae23d74ab93["EpollDatagramScatteringReadTest"]
  f4d1d0b2_a844_3401_faf5_9c777d8b6f12["EpollDatagramScatteringReadTest.java"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|defined in| f4d1d0b2_a844_3401_faf5_9c777d8b6f12
  03e818cd_4675_4d23_9da6_c011346e0d09["assumeRecvmmsgSupported()"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|method| 03e818cd_4675_4d23_9da6_c011346e0d09
  7bd75a3c_71d3_9c0a_7705_573a6a2b52b1["newFactories()"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|method| 7bd75a3c_71d3_9c0a_7705_573a6a2b52b1
  ee737cf6_85f3_169a_eea6_2c8200de93bf["testScatteringReadPartial()"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|method| ee737cf6_85f3_169a_eea6_2c8200de93bf
  fca9b29e_aca9_02a6_d768_2be66ed52c3e["testScatteringRead()"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|method| fca9b29e_aca9_02a6_d768_2be66ed52c3e
  8201578a_8907_347f_e1cc_273e339986c4["testScatteringReadConnectedPartial()"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|method| 8201578a_8907_347f_e1cc_273e339986c4
  cabcf18b_2d9d_dda4_89c9_0ff45f429ac8["testScatteringConnectedRead()"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|method| cabcf18b_2d9d_dda4_89c9_0ff45f429ac8
  938686fd_bcbc_656b_0089_cf4abaa740f1["testScatteringReadWithSmallBuffer()"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|method| 938686fd_bcbc_656b_0089_cf4abaa740f1
  ca9cca6b_d225_bd0a_63c0_29218f0fdadb["testScatteringConnectedReadWithSmallBuffer()"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|method| ca9cca6b_d225_bd0a_63c0_29218f0fdadb
  da055b2f_ebc1_2209_ca25_ac81e49ad730["testScatteringReadWithSmallBuffer0()"]
  84cf7040_5cb1_94bd_4284_dae23d74ab93 -->|method| da055b2f_ebc1_2209_ca25_ac81e49ad730

Relationship Graph

Source Code

transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollDatagramScatteringReadTest.java lines 47–307

public class EpollDatagramScatteringReadTest extends AbstractDatagramTest  {

    @BeforeAll
    public static void assumeRecvmmsgSupported() {
        assumeTrue(Native.IS_SUPPORTING_RECVMMSG);
    }

    @Override
    protected List<TestsuitePermutation.BootstrapComboFactory<Bootstrap, Bootstrap>> newFactories() {
        return EpollSocketTestPermutation.INSTANCE.epollOnlyDatagram(socketProtocolFamily());
    }

    @Test
    public void testScatteringReadPartial(TestInfo testInfo) throws Throwable {
        run(testInfo, new Runner<Bootstrap, Bootstrap>() {
            @Override
            public void run(Bootstrap bootstrap, Bootstrap bootstrap2) throws Throwable {
                testScatteringReadPartial(bootstrap, bootstrap2);
            }
        });
    }

    public void testScatteringReadPartial(Bootstrap sb, Bootstrap cb) throws Throwable {
        testScatteringRead(sb, cb, false, true);
    }

    @Test
    public void testScatteringRead(TestInfo testInfo) throws Throwable {
        run(testInfo, new Runner<Bootstrap, Bootstrap>() {
            @Override
            public void run(Bootstrap bootstrap, Bootstrap bootstrap2) throws Throwable {
                testScatteringRead(bootstrap, bootstrap2);
            }
        });
    }

    public void testScatteringRead(Bootstrap sb, Bootstrap cb) throws Throwable {
        testScatteringRead(sb, cb, false, false);
    }

    @Test
    public void testScatteringReadConnectedPartial(TestInfo testInfo) throws Throwable {
        run(testInfo, new Runner<Bootstrap, Bootstrap>() {
            @Override
            public void run(Bootstrap bootstrap, Bootstrap bootstrap2) throws Throwable {
                testScatteringReadConnectedPartial(bootstrap, bootstrap2);
            }
        });
    }

    public void testScatteringReadConnectedPartial(Bootstrap sb, Bootstrap cb) throws Throwable {
        testScatteringRead(sb, cb, true, true);
    }

    @Test
    public void testScatteringConnectedRead(TestInfo testInfo) throws Throwable {
        run(testInfo, new Runner<Bootstrap, Bootstrap>() {
            @Override
            public void run(Bootstrap bootstrap, Bootstrap bootstrap2) throws Throwable {
                testScatteringConnectedRead(bootstrap, bootstrap2);
            }
        });
    }

    public void testScatteringConnectedRead(Bootstrap sb, Bootstrap cb) throws Throwable {
        testScatteringRead(sb, cb, true, false);
    }

    private void testScatteringRead(Bootstrap sb, Bootstrap cb, boolean connected, boolean partial) throws Throwable {
        int packetSize = 8;
        int numPackets = 4;

        sb.option(ChannelOption.RECVBUF_ALLOCATOR, new AdaptiveRecvByteBufAllocator(
                packetSize, packetSize * (partial ? numPackets / 2 : numPackets), 64 * 1024));
        // Set the MAX_DATAGRAM_PAYLOAD_SIZE to something bigger then the actual packet size.
        // This will allow us to check if we correctly thread the received len.
        sb.option(EpollChannelOption.MAX_DATAGRAM_PAYLOAD_SIZE, packetSize * 2);

        Channel sc = null;
        Channel cc = null;

Frequently Asked Questions

What is the EpollDatagramScatteringReadTest class?
EpollDatagramScatteringReadTest is a class in the netty codebase, defined in transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollDatagramScatteringReadTest.java.
Where is EpollDatagramScatteringReadTest defined?
EpollDatagramScatteringReadTest is defined in transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollDatagramScatteringReadTest.java at line 47.

Analyze Your Own Codebase

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

Try Supermodel Free