Home / Function/ isSctpSupported() — netty Function Reference

isSctpSupported() — netty Function Reference

Architecture documentation for the isSctpSupported() function in TestUtils.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d75da533_144a_c7de_966c_b12d5906fe28["isSctpSupported()"]
  1dee7150_7837_4c34_2e0a_b594ae531484["TestUtils"]
  d75da533_144a_c7de_966c_b12d5906fe28 -->|defined in| 1dee7150_7837_4c34_2e0a_b594ae531484
  style d75da533_144a_c7de_966c_b12d5906fe28 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

testsuite/src/main/java/io/netty/testsuite/util/TestUtils.java lines 76–102

    public static boolean isSctpSupported() {
        String os = System.getProperty("os.name").toLowerCase(Locale.US);
        if ("unix".equals(os) || "linux".equals(os) || "sun".equals(os) || "solaris".equals(os)) {
            try {
                // Try to open a SCTP Channel, by using reflection to make it compile also on
                // operation systems that not support SCTP like OSX and Windows
                Class<?> sctpChannelClass = Class.forName("com.sun.nio.sctp.SctpChannel");
                Channel channel = (Channel) sctpChannelClass.getMethod("open").invoke(null);
                try {
                    channel.close();
                } catch (IOException e) {
                    // ignore
                }
            } catch (UnsupportedOperationException e) {
                // This exception may get thrown if the OS does not have
                // the shared libs installed.
                System.out.print("Not supported: " + e.getMessage());
                return false;
            } catch (Throwable t) {
                if (!(t instanceof IOException)) {
                    return false;
                }
            }
            return true;
        }
        return false;
    }

Domain

Subdomains

Frequently Asked Questions

What does isSctpSupported() do?
isSctpSupported() is a function in the netty codebase, defined in testsuite/src/main/java/io/netty/testsuite/util/TestUtils.java.
Where is isSctpSupported() defined?
isSctpSupported() is defined in testsuite/src/main/java/io/netty/testsuite/util/TestUtils.java at line 76.

Analyze Your Own Codebase

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

Try Supermodel Free