Class UnixDomainSocketFactory


  • @Contract(threading=STATELESS)
    @Internal
    public final class UnixDomainSocketFactory
    extends java.lang.Object
    A factory for Unix domain sockets.

    This implementation supports both the JDK16+ standard library implementation (JEP 380) and the JUnixSocket library. It will automatically detect which implementation is available and use it; if both are available, the standard library implementation is preferred.

    Since:
    5.6
    • Constructor Detail

      • UnixDomainSocketFactory

        public UnixDomainSocketFactory()
    • Method Detail

      • isAvailable

        public static boolean isAvailable()
        Checks if Unix Domain Socket support is available.
        Returns:
        true if Unix Domain Socket support is available, false otherwise
      • createSocketAddress

        public java.net.SocketAddress createSocketAddress​(java.nio.file.Path socketPath)
      • createSocket

        public java.net.Socket createSocket()
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • connectSocket

        public java.net.Socket connectSocket​(java.net.Socket socket,
                                             java.nio.file.Path socketPath,
                                             org.apache.hc.core5.util.TimeValue connectTimeout)
                                      throws java.io.IOException
        Throws:
        java.io.IOException