Class UnixDomainSocketFactory

java.lang.Object
org.apache.hc.client5.http.socket.UnixDomainSocketFactory

@Contract(threading=STATELESS) @Internal public final class UnixDomainSocketFactory extends 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 Details

    • UnixDomainSocketFactory

      public UnixDomainSocketFactory()
  • Method Details

    • isAvailable

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

      public static UnixDomainSocketFactory getSocketFactory()
      Gets the singleton instance of UnixDomainSocketFactory.
      Returns:
      the singleton instance
    • createSocketAddress

      public SocketAddress createSocketAddress(Path socketPath)
    • createSocket

      public Socket createSocket() throws IOException
      Throws:
      IOException
    • connectSocket

      public Socket connectSocket(Socket socket, Path socketPath, org.apache.hc.core5.util.TimeValue connectTimeout) throws IOException
      Throws:
      IOException