|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.conn.scheme.PlainSocketFactory
@Immutable public final class PlainSocketFactory
The default class for creating plain (unencrypted) sockets.
The following parameters can be used to customize the behavior of this class:
| Constructor Summary | |
|---|---|
PlainSocketFactory()
|
|
PlainSocketFactory(HostNameResolver nameResolver)
|
|
| Method Summary | |
|---|---|
Socket |
connectSocket(Socket sock,
String host,
int port,
InetAddress localAddress,
int localPort,
HttpParams params)
Connects a socket to the given host. |
Socket |
createSocket()
Creates a new, unconnected socket. |
static PlainSocketFactory |
getSocketFactory()
Gets the default factory. |
boolean |
isSecure(Socket sock)
Checks whether a socket connection is secure. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PlainSocketFactory(HostNameResolver nameResolver)
public PlainSocketFactory()
| Method Detail |
|---|
public static PlainSocketFactory getSocketFactory()
public Socket createSocket()
SocketFactoryconnectSocket.
createSocket in interface SocketFactory
public Socket connectSocket(Socket sock,
String host,
int port,
InetAddress localAddress,
int localPort,
HttpParams params)
throws IOException
SocketFactory
connectSocket in interface SocketFactorysock - the socket to connect, as obtained from
createSocket.
null indicates that a new socket
should be created and connected.host - the host to connect toport - the port to connect to on the hostlocalAddress - the local address to bind the socket to, or
null for anylocalPort - the port on the local machine,
0 or a negative number for anyparams - additional parameters for connecting
sock argument if this factory supports
a layered protocol.
IOException - if an I/O error occurs
UnknownHostException - if the IP address of the target host
can not be determined
ConnectTimeoutException - if the socket cannot be connected
within the time limit defined in the params
public final boolean isSecure(Socket sock)
throws IllegalArgumentException
isSecure in interface SocketFactorysock - the connected socket
false
IllegalArgumentException - if the argument is invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||