Home / Function/ processSelectedKeysPlain() — netty Function Reference

processSelectedKeysPlain() — netty Function Reference

Architecture documentation for the processSelectedKeysPlain() function in NioIoHandler.java from the netty codebase.

Function java Buffer Telemetry calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  1b0b7e3a_8aa0_e5ec_b668_d4f04f445265["processSelectedKeysPlain()"]
  db526e28_8aae_a182_b56b_dc12824d89f5["NioIoHandler"]
  1b0b7e3a_8aa0_e5ec_b668_d4f04f445265 -->|defined in| db526e28_8aae_a182_b56b_dc12824d89f5
  bb59a7a2_77ef_52ff_0c57_820c55b1ec5b["processSelectedKeys()"]
  bb59a7a2_77ef_52ff_0c57_820c55b1ec5b -->|calls| 1b0b7e3a_8aa0_e5ec_b668_d4f04f445265
  aca109d8_122e_b26d_bc0c_7282ec7c38da["processSelectedKey()"]
  1b0b7e3a_8aa0_e5ec_b668_d4f04f445265 -->|calls| aca109d8_122e_b26d_bc0c_7282ec7c38da
  0da770a6_c2c1_ab83_acae_aaaf42049c37["selectAgain()"]
  1b0b7e3a_8aa0_e5ec_b668_d4f04f445265 -->|calls| 0da770a6_c2c1_ab83_acae_aaaf42049c37
  style 1b0b7e3a_8aa0_e5ec_b668_d4f04f445265 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/nio/NioIoHandler.java lines 527–561

    private int processSelectedKeysPlain(Set<SelectionKey> selectedKeys) {
        // check if the set is empty and if so just return to not create garbage by
        // creating a new Iterator every time even if there is nothing to process.
        // See https://github.com/netty/netty/issues/597
        if (selectedKeys.isEmpty()) {
            return 0;
        }

        Iterator<SelectionKey> i = selectedKeys.iterator();
        int handled = 0;
        for (;;) {
            final SelectionKey k = i.next();
            i.remove();

            processSelectedKey(k);
            ++handled;

            if (!i.hasNext()) {
                break;
            }

            if (needsToSelectAgain) {
                selectAgain();
                selectedKeys = selector.selectedKeys();

                // Create the iterator again to avoid ConcurrentModificationException
                if (selectedKeys.isEmpty()) {
                    break;
                } else {
                    i = selectedKeys.iterator();
                }
            }
        }
        return handled;
    }

Domain

Subdomains

Frequently Asked Questions

What does processSelectedKeysPlain() do?
processSelectedKeysPlain() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/nio/NioIoHandler.java.
Where is processSelectedKeysPlain() defined?
processSelectedKeysPlain() is defined in transport/src/main/java/io/netty/channel/nio/NioIoHandler.java at line 527.
What does processSelectedKeysPlain() call?
processSelectedKeysPlain() calls 2 function(s): processSelectedKey, selectAgain.
What calls processSelectedKeysPlain()?
processSelectedKeysPlain() is called by 1 function(s): processSelectedKeys.

Analyze Your Own Codebase

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

Try Supermodel Free