org.apache.hc.client5.http.socket

## 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 Summary

Constructors
Constructor and Description
`UnixDomainSocketFactory()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Socket` `connectSocket(Socket socket, Path socketPath, TimeValue connectTimeout)`
`Socket` `createSocket()`
`SocketAddress` `createSocketAddress(Path socketPath)`
`static UnixDomainSocketFactory` `getSocketFactory()` Gets the singleton instance of `UnixDomainSocketFactory`.
`static boolean` `isAvailable()` Checks if Unix Domain Socket support is available.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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

#### 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,
                                TimeValue connectTimeout)
                         throws IOException

Throws:
  `IOException`