Class UnixDomainSocketFactory
- java.lang.Object
-
- org.apache.hc.client5.http.socket.UnixDomainSocketFactory
-
@Contract(threading=STATELESS) @Internal public final class UnixDomainSocketFactory extends java.lang.ObjectA 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 Description UnixDomainSocketFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.SocketconnectSocket(java.net.Socket socket, java.nio.file.Path socketPath, org.apache.hc.core5.util.TimeValue connectTimeout)java.net.SocketcreateSocket()java.net.SocketAddresscreateSocketAddress(java.nio.file.Path socketPath)static UnixDomainSocketFactorygetSocketFactory()Gets the singleton instance ofUnixDomainSocketFactory.static booleanisAvailable()Checks if Unix Domain Socket support is available.
-
-
-
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 ofUnixDomainSocketFactory.- Returns:
- the singleton instance
-
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
-
-