Class UnixDomainSocketFactory
java.lang.Object
org.apache.hc.client5.http.socket.UnixDomainSocketFactory
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 -
Method Summary
Modifier and TypeMethodDescriptionconnectSocket(Socket socket, Path socketPath, org.apache.hc.core5.util.TimeValue connectTimeout) createSocketAddress(Path socketPath) static UnixDomainSocketFactoryGets the singleton instance ofUnixDomainSocketFactory.static booleanChecks if Unix Domain Socket support is available.
-
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
Gets the singleton instance ofUnixDomainSocketFactory.- Returns:
- the singleton instance
-
createSocketAddress
-
createSocket
- Throws:
IOException
-
connectSocket
public Socket connectSocket(Socket socket, Path socketPath, org.apache.hc.core5.util.TimeValue connectTimeout) throws IOException - Throws:
IOException
-