Package org.apache.http.conn
Class MultihomePlainSocketFactory
- java.lang.Object
-
- org.apache.http.conn.MultihomePlainSocketFactory
-
- All Implemented Interfaces:
SocketFactory
@Deprecated @Contract(threading=IMMUTABLE) public final class MultihomePlainSocketFactory extends java.lang.Object implements SocketFactory
Deprecated.(4.1) Do not use. For multihome support socket factories must implementSchemeSocketFactory
interface.Socket factory that implements a simple multi-home fail-over on connect failure, provided the same hostname resolves to multipleInetAddress
es. Please note theconnectSocket(Socket, String, int, InetAddress, int, HttpParams)
method cannot be reliably interrupted by closing the socket returned by thecreateSocket()
method.- Since:
- 4.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.net.Socket
connectSocket(java.net.Socket socket, java.lang.String host, int port, java.net.InetAddress localAddress, int localPort, HttpParams params)
Deprecated.Attempts to connects the socket to any of theInetAddress
es the given host name resolves to.java.net.Socket
createSocket()
Deprecated.Creates a new, unconnected socket.static MultihomePlainSocketFactory
getSocketFactory()
Deprecated.Gets the singleton instance of this class.boolean
isSecure(java.net.Socket sock)
Deprecated.Checks whether a socket connection is secure.
-
-
-
Method Detail
-
getSocketFactory
public static MultihomePlainSocketFactory getSocketFactory()
Deprecated.Gets the singleton instance of this class.- Returns:
- the one and only plain socket factory
-
createSocket
public java.net.Socket createSocket()
Deprecated.Description copied from interface:SocketFactory
Creates a new, unconnected socket. The socket should subsequently be passed toconnectSocket
.- Specified by:
createSocket
in interfaceSocketFactory
- Returns:
- a new socket
-
connectSocket
public java.net.Socket connectSocket(java.net.Socket socket, java.lang.String host, int port, java.net.InetAddress localAddress, int localPort, HttpParams params) throws java.io.IOException
Deprecated.Attempts to connects the socket to any of theInetAddress
es the given host name resolves to. If connection to all addresses fail, the last I/O exception is propagated to the caller.- Specified by:
connectSocket
in interfaceSocketFactory
- Parameters:
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 parameters- Returns:
- the connected socket. The returned object may be different
from the
sock
argument if this factory supports a layered protocol. - Throws:
java.io.IOException
- if an error occurs during the connectionjava.net.SocketTimeoutException
- if timeout expires before connecting
-
isSecure
public final boolean isSecure(java.net.Socket sock) throws java.lang.IllegalArgumentException
Deprecated.Checks whether a socket connection is secure. This factory creates plain socket connections which are not considered secure.- Specified by:
isSecure
in interfaceSocketFactory
- Parameters:
sock
- the connected socket- Returns:
false
- Throws:
java.lang.IllegalArgumentException
- if the argument is invalid
-
-