Home / Function/ handle() — netty Function Reference

handle() — netty Function Reference

Architecture documentation for the handle() function in AbstractIoUringChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8["handle()"]
  19011d76_ce85_4831_bbdf_3b21a88f2b1b["AbstractUringUnsafe"]
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8 -->|defined in| 19011d76_ce85_4831_bbdf_3b21a88f2b1b
  3695afb9_15b2_6326_e381_ade2ba128b2a["readComplete()"]
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8 -->|calls| 3695afb9_15b2_6326_e381_ade2ba128b2a
  02484f5e_fddd_74b7_e73c_1b14fb1d53cf["writeComplete()"]
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8 -->|calls| 02484f5e_fddd_74b7_e73c_1b14fb1d53cf
  fa9b16c6_c963_88d2_4e5b_2bd377a7b30c["pollAddComplete()"]
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8 -->|calls| fa9b16c6_c963_88d2_4e5b_2bd377a7b30c
  4951b1f3_409c_edc3_46eb_25dbccd876cb["cancelComplete0()"]
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8 -->|calls| 4951b1f3_409c_edc3_46eb_25dbccd876cb
  7ca63cf2_401d_5282_550f_f023bb1b2458["connectComplete()"]
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8 -->|calls| 7ca63cf2_401d_5282_550f_f023bb1b2458
  74154ae0_fd75_6c44_c1e5_89945141fcf3["freeMsgHdrArray()"]
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8 -->|calls| 74154ae0_fd75_6c44_c1e5_89945141fcf3
  fba8adc4_a17f_4db6_3240_c3e0300aca8e["freeRemoteAddressMemory()"]
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8 -->|calls| fba8adc4_a17f_4db6_3240_c3e0300aca8e
  8147a0ed_8013_83a9_479a_7347b58094a7["handleDelayedClosed()"]
  5f45f466_5da9_76a6_e49e_f54bf3e34ae8 -->|calls| 8147a0ed_8013_83a9_479a_7347b58094a7
  style 5f45f466_5da9_76a6_e49e_f54bf3e34ae8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringChannel.java lines 449–505

        @Override
        public final void handle(IoRegistration registration, IoEvent ioEvent) {
            IoUringIoEvent event = (IoUringIoEvent) ioEvent;
            byte op = event.opcode();
            int res = event.res();
            int flags = event.flags();
            short data = event.data();
            switch (op) {
                case Native.IORING_OP_RECV:
                case Native.IORING_OP_ACCEPT:
                case Native.IORING_OP_RECVMSG:
                case Native.IORING_OP_READ:
                    readComplete(op, res, flags, data);
                    break;
                case Native.IORING_OP_WRITEV:
                case Native.IORING_OP_SEND:
                case Native.IORING_OP_SENDMSG:
                case Native.IORING_OP_WRITE:
                case Native.IORING_OP_SPLICE:
                case Native.IORING_OP_SEND_ZC:
                case Native.IORING_OP_SENDMSG_ZC:
                    writeComplete(op, res, flags, data);
                    break;
                case Native.IORING_OP_POLL_ADD:
                    pollAddComplete(res, flags, data);
                    break;
                case Native.IORING_OP_ASYNC_CANCEL:
                    cancelComplete0(op, res, flags, data);
                    break;
                case Native.IORING_OP_CONNECT:
                    connectComplete(op, res, flags, data);

                    // once the connect was completed we can also free some resources that are not needed anymore.
                    freeMsgHdrArray();
                    freeRemoteAddressMemory();
                    break;
                case Native.IORING_OP_CLOSE:
                    if (res != Native.ERRNO_ECANCELED_NEGATIVE) {
                        if (delayedClose != null) {
                            delayedClose.promise.setSuccess();
                        }
                        closed = true;
                    }
                    break;
                default:
                    break;
            }

            // We delay the actual close if there is still a write or read scheduled, let's see if there
            // was a close that needs to be done now.
            handleDelayedClosed();

            if (ioState == 0 && closed) {
                // Cancel the registration now.
                registration.cancel();
            }
        }

Domain

Subdomains

Frequently Asked Questions

What does handle() do?
handle() is a function in the netty codebase, defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringChannel.java.
Where is handle() defined?
handle() is defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringChannel.java at line 449.
What does handle() call?
handle() calls 8 function(s): cancelComplete0, connectComplete, freeMsgHdrArray, freeRemoteAddressMemory, handleDelayedClosed, pollAddComplete, readComplete, writeComplete.

Analyze Your Own Codebase

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

Try Supermodel Free