Home / Function/ getOptions() — netty Function Reference

getOptions() — netty Function Reference

Architecture documentation for the getOptions() function in NioChannelOption.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  527e22c8_8275_833c_6a91_1edf1fddd32c["getOptions()"]
  5e76b03b_2ef8_0a9c_1166_be79b066b796["NioChannelOption"]
  527e22c8_8275_833c_6a91_1edf1fddd32c -->|defined in| 5e76b03b_2ef8_0a9c_1166_be79b066b796
  0109bc40_f09d_0582_ea32_64f68b7f7356["NioChannelOption()"]
  527e22c8_8275_833c_6a91_1edf1fddd32c -->|calls| 0109bc40_f09d_0582_ea32_64f68b7f7356
  style 527e22c8_8275_833c_6a91_1edf1fddd32c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/socket/nio/NioChannelOption.java lines 89–114

    @SuppressWarnings("unchecked")
    static ChannelOption<?>[] getOptions(Channel jdkChannel) {
        NetworkChannel channel = (NetworkChannel) jdkChannel;
        Set<SocketOption<?>> supportedOpts = channel.supportedOptions();

        if (channel instanceof ServerSocketChannel) {
            List<ChannelOption<?>> extraOpts = new ArrayList<ChannelOption<?>>(supportedOpts.size());
            for (SocketOption<?> opt : supportedOpts) {
                if (opt == StandardSocketOptions.IP_TOS) {
                    // Skip IP_TOS as a workaround for a JDK bug:
                    // See https://mail.openjdk.java.net/pipermail/nio-dev/2018-August/005365.html
                    continue;
                }
                extraOpts.add(new NioChannelOption(opt));
            }
            return extraOpts.toArray(new ChannelOption[0]);
        } else {
            ChannelOption<?>[] extraOpts = new ChannelOption[supportedOpts.size()];

            int i = 0;
            for (SocketOption<?> opt : supportedOpts) {
                extraOpts[i++] = new NioChannelOption(opt);
            }
            return extraOpts;
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does getOptions() do?
getOptions() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/socket/nio/NioChannelOption.java.
Where is getOptions() defined?
getOptions() is defined in transport/src/main/java/io/netty/channel/socket/nio/NioChannelOption.java at line 89.
What does getOptions() call?
getOptions() calls 1 function(s): NioChannelOption.

Analyze Your Own Codebase

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

Try Supermodel Free