Home / Class/ IoUringAutoReadTest Class — netty Architecture

IoUringAutoReadTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  41674e9f_1b3e_5289_3334_fce73410961a["IoUringAutoReadTest"]
  d7e6f7a9_0ee8_a6e1_dbc9_b6c550da3240["IoUringAutoReadTest.java"]
  41674e9f_1b3e_5289_3334_fce73410961a -->|defined in| d7e6f7a9_0ee8_a6e1_dbc9_b6c550da3240
  7d7cb1f3_d44c_84ca_781a_8501dba2101f["loadJNI()"]
  41674e9f_1b3e_5289_3334_fce73410961a -->|method| 7d7cb1f3_d44c_84ca_781a_8501dba2101f
  a8e6b5c6_90ca_c5fb_cff6_a8488111dfd5["testLateAutoRead()"]
  41674e9f_1b3e_5289_3334_fce73410961a -->|method| a8e6b5c6_90ca_c5fb_cff6_a8488111dfd5

Relationship Graph

Source Code

transport-native-io_uring/src/test/java/io/netty/channel/uring/IoUringAutoReadTest.java lines 36–81

public class IoUringAutoReadTest {

    @BeforeAll
    public static void loadJNI() {
        assumeTrue(IoUring.isAvailable());
    }

    @Test
    @Timeout(value = 1, unit = TimeUnit.MINUTES)
    public void testLateAutoRead() throws Exception {
        IoEventLoopGroup group = new MultiThreadIoEventLoopGroup(1, IoUringIoHandler.newFactory());
        try {
            ServerSocketChannel server = (ServerSocketChannel) new ServerBootstrap()
                    .group(group)
                    .channel(IoUringServerSocketChannel.class)
                    .childHandler(new ChannelInboundHandlerAdapter() {
                        @Override
                        public void channelRead(ChannelHandlerContext ctx, Object msg) {
                            ctx.channel().config().setAutoRead(false);
                            ctx.writeAndFlush(msg, ctx.voidPromise());
                        }

                        @Override
                        public void channelReadComplete(ChannelHandlerContext ctx) {
                            ctx.read();
                        }
                    })
                    .bind(0).sync().channel();

            try (Socket sock = new Socket(server.localAddress().getAddress(), server.localAddress().getPort())) {
                OutputStream out = sock.getOutputStream();
                InputStream in = sock.getInputStream();

                out.write(1);
                out.flush();
                Assertions.assertEquals(1, in.read());

                out.write(2);
                out.flush();
                Assertions.assertEquals(2, in.read());
            }
        } finally {
            group.shutdownGracefully();
        }
    }
}

Frequently Asked Questions

What is the IoUringAutoReadTest class?
IoUringAutoReadTest is a class in the netty codebase, defined in transport-native-io_uring/src/test/java/io/netty/channel/uring/IoUringAutoReadTest.java.
Where is IoUringAutoReadTest defined?
IoUringAutoReadTest is defined in transport-native-io_uring/src/test/java/io/netty/channel/uring/IoUringAutoReadTest.java at line 36.

Analyze Your Own Codebase

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

Try Supermodel Free