Home / Function/ scheduleRead0() — netty Function Reference

scheduleRead0() — netty Function Reference

Architecture documentation for the scheduleRead0() function in AbstractIoUringStreamChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  59498236_2b4d_5c66_9f07_08c2b7375a6b["scheduleRead0()"]
  2ef046a1_16aa_1708_4ba7_113c9fa2862e["IoUringStreamUnsafe"]
  59498236_2b4d_5c66_9f07_08c2b7375a6b -->|defined in| 2ef046a1_16aa_1708_4ba7_113c9fa2862e
  fa8d19bc_1143_f4c3_84c4_ef07823cb9be["scheduleReadProviderBuffer()"]
  59498236_2b4d_5c66_9f07_08c2b7375a6b -->|calls| fa8d19bc_1143_f4c3_84c4_ef07823cb9be
  7684e1d1_c90a_3647_fca5_52c1485dbb4e["calculateRecvIoPrio()"]
  59498236_2b4d_5c66_9f07_08c2b7375a6b -->|calls| 7684e1d1_c90a_3647_fca5_52c1485dbb4e
  f3971f93_dbcb_2767_5244_f09d3a29db3d["calculateRecvFlags()"]
  59498236_2b4d_5c66_9f07_08c2b7375a6b -->|calls| f3971f93_dbcb_2767_5244_f09d3a29db3d
  style 59498236_2b4d_5c66_9f07_08c2b7375a6b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringStreamChannel.java lines 331–364

        @Override
        protected int scheduleRead0(boolean first, boolean socketIsEmpty) {
            assert readBuffer == null;
            assert readId == 0 : readId;
            final IoUringRecvByteAllocatorHandle allocHandle = recvBufAllocHandle();

            if (bufferRing != null && bufferRing.isUsable()) {
                return scheduleReadProviderBuffer(bufferRing, first, socketIsEmpty);
            }

            // We either have no buffer ring configured or we force a recv without using a buffer ring.
            ByteBuf byteBuf = allocHandle.allocate(alloc());
            try {
                int fd = fd().intValue();
                IoRegistration registration = registration();
                short ioPrio = calculateRecvIoPrio(first, socketIsEmpty);
                int recvFlags = calculateRecvFlags(first);

                IoUringIoOps ops = IoUringIoOps.newRecv(fd, (byte) 0, ioPrio, recvFlags,
                        IoUring.memoryAddress(byteBuf) + byteBuf.writerIndex(), byteBuf.writableBytes(), nextOpsId());
                readId = registration.submit(ops);
                readOpCode = Native.IORING_OP_RECV;
                if (readId == 0) {
                    return 0;
                }
                readBuffer = byteBuf;
                byteBuf = null;
                return 1;
            } finally {
                if (byteBuf != null) {
                    byteBuf.release();
                }
            }
        }

Domain

Subdomains

Frequently Asked Questions

What does scheduleRead0() do?
scheduleRead0() is a function in the netty codebase, defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringStreamChannel.java.
Where is scheduleRead0() defined?
scheduleRead0() is defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringStreamChannel.java at line 331.
What does scheduleRead0() call?
scheduleRead0() calls 3 function(s): calculateRecvFlags, calculateRecvIoPrio, scheduleReadProviderBuffer.

Analyze Your Own Codebase

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

Try Supermodel Free