SchemeSocketFactory
interface.@Deprecated @Contract(threading=IMMUTABLE) public final class MultihomePlainSocketFactory extends Object implements SocketFactory
InetAddress
es. Please note
the connectSocket(Socket, String, int, InetAddress, int, HttpParams)
method cannot be reliably interrupted by closing the socket returned by the
createSocket()
method.Modifier and Type | Method and Description |
---|---|
Socket |
connectSocket(Socket socket,
String host,
int port,
InetAddress localAddress,
int localPort,
org.apache.http.params.HttpParams params)
Deprecated.
Attempts to connects the socket to any of the
InetAddress es the
given host name resolves to. |
Socket |
createSocket()
Deprecated.
Creates a new, unconnected socket.
|
static MultihomePlainSocketFactory |
getSocketFactory()
Deprecated.
Gets the singleton instance of this class.
|
boolean |
isSecure(Socket sock)
Deprecated.
Checks whether a socket connection is secure.
|
public static MultihomePlainSocketFactory getSocketFactory()
public Socket createSocket()
SocketFactory
connectSocket
.createSocket
in interface SocketFactory
public Socket connectSocket(Socket socket, String host, int port, InetAddress localAddress, int localPort, org.apache.http.params.HttpParams params) throws IOException
InetAddress
es the
given host name resolves to. If connection to all addresses fail, the
last I/O exception is propagated to the caller.connectSocket
in interface SocketFactory
socket
- socket to connect to any of the given addresseshost
- Host name to connect toport
- the port to connect tolocalAddress
- local addresslocalPort
- local portparams
- HTTP parameterssock
argument if this factory supports
a layered protocol.IOException
- if an error occurs during the connectionSocketTimeoutException
- if timeout expires before connectingpublic boolean isSecure(Socket sock) throws IllegalArgumentException
isSecure
in interface SocketFactory
sock
- the connected socketfalse
IllegalArgumentException
- if the argument is invalidCopyright © 1999–2022 The Apache Software Foundation. All rights reserved.