|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.conn.MultihomePlainSocketFactory
public final class MultihomePlainSocketFactory
Socket factory that implements a simple multi-home fail-over on connect failure,
provided the same hostname resolves to multiple InetAddresses. Please note
the connectSocket(Socket, String, int, InetAddress, int, HttpParams)
method cannot be reliably interrupted by closing the socket returned by the
createSocket() method.
| Method Summary | |
|---|---|
java.net.Socket |
connectSocket(java.net.Socket sock,
java.lang.String host,
int port,
java.net.InetAddress localAddress,
int localPort,
org.apache.http.params.HttpParams params)
Attempts to connects the socket to any of the InetAddresses the
given host name resolves to. |
java.net.Socket |
createSocket()
Creates a new, unconnected socket. |
boolean |
equals(java.lang.Object obj)
Compares this factory with an object. |
static MultihomePlainSocketFactory |
getSocketFactory()
Gets the singleton instance of this class. |
int |
hashCode()
Obtains a hash code for this object. |
boolean |
isSecure(java.net.Socket sock)
Checks whether a socket connection is secure. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static MultihomePlainSocketFactory getSocketFactory()
public java.net.Socket createSocket()
SocketFactoryconnectSocket.
createSocket in interface SocketFactory
public java.net.Socket connectSocket(java.net.Socket sock,
java.lang.String host,
int port,
java.net.InetAddress localAddress,
int localPort,
org.apache.http.params.HttpParams params)
throws java.io.IOException
InetAddresses 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 SocketFactorysock - 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
sock argument if this factory supports
a layered protocol.
java.io.IOException - if an error occurs during the connection
java.net.SocketTimeoutException - if timeout expires before connecting
public final boolean isSecure(java.net.Socket sock)
throws java.lang.IllegalArgumentException
isSecure in interface SocketFactorysock - the connected socket
false
java.lang.IllegalArgumentException - if the argument is invalidpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to compare with
public int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||