SocketFactorypublic interface SocketFactory A factory for creating and connecting sockets.
The factory encapsulates the logic for establishing a socket connection.
Both {@link java.lang.Object#equals(java.lang.Object) Object.equals()}
and {@link java.lang.Object#hashCode() Object.hashCode()}
must be overridden for the correct operation of some connection managers. |
Methods Summary |
---|
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)Connects a socket to the given host.
| public java.net.Socket | createSocket()Creates a new, unconnected socket.
The socket should subsequently be passed to
{@link #connectSocket connectSocket}.
| public boolean | isSecure(java.net.Socket sock)Checks whether a socket provides a secure connection.
The socket must be {@link #connectSocket connected}
by this factory.
The factory will not perform I/O operations
in this method.
As a rule of thumb, plain sockets are not secure and
TLS/SSL sockets are secure. However, there may be
application specific deviations. For example, a plain
socket to a host in the same intranet ("trusted zone")
could be considered secure. On the other hand, a
TLS/SSL socket could be considered insecure based on
the cypher suite chosen for the connection.
|
|