Home / Function/ loadTcNative() — netty Function Reference

loadTcNative() — netty Function Reference

Architecture documentation for the loadTcNative() function in OpenSsl.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  483ce149_e5c5_8dcf_dc0d_f6cdef18556c["loadTcNative()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6["OpenSsl"]
  483ce149_e5c5_8dcf_dc0d_f6cdef18556c -->|defined in| ed038636_6deb_9fdb_0fd6_26635e25e0e6
  style 483ce149_e5c5_8dcf_dc0d_f6cdef18556c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/OpenSsl.java lines 746–775

    private static void loadTcNative() throws Exception {
        String os = PlatformDependent.normalizedOs();
        String arch = PlatformDependent.normalizedArch();

        Set<String> libNames = new LinkedHashSet<String>(5);
        String staticLibName = "netty_tcnative";

        // First, try loading the platform-specific library. Platform-specific
        // libraries will be available if using a tcnative uber jar.
        if ("linux".equals(os)) {
            Set<String> classifiers = PlatformDependent.normalizedLinuxClassifiers();
            for (String classifier : classifiers) {
                libNames.add(staticLibName + "_" + os + '_' + arch + "_" + classifier);
            }
            // generic arch-dependent library
            libNames.add(staticLibName + "_" + os + '_' + arch);

            // Fedora SSL lib so naming (libssl.so.10 vs libssl.so.1.0.0).
            // note: should already be included from the classifiers but if not, we use this as an
            //       additional fallback option here
            libNames.add(staticLibName + "_" + os + '_' + arch + "_fedora");
        } else {
            libNames.add(staticLibName + "_" + os + '_' + arch);
        }
        libNames.add(staticLibName + "_" + arch);
        libNames.add(staticLibName);

        NativeLibraryLoader.loadFirstAvailable(PlatformDependent.getClassLoader(SSLContext.class),
            libNames.toArray(EmptyArrays.EMPTY_STRINGS));
    }

Domain

Subdomains

Frequently Asked Questions

What does loadTcNative() do?
loadTcNative() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/OpenSsl.java.
Where is loadTcNative() defined?
loadTcNative() is defined in handler/src/main/java/io/netty/handler/ssl/OpenSsl.java at line 746.

Analyze Your Own Codebase

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

Try Supermodel Free