OperatedClientConnectionpublic interface OperatedClientConnection implements HttpClientConnection, HttpInetConnectionA client-side connection that relies on outside logic to connect sockets to the
appropriate hosts. It can be operated directly by an application, or through an
{@link ClientConnectionOperator operator}. |
Methods Summary |
---|
public java.net.Socket | getSocket()Obtains the socket for this connection.
The return value is well-defined only while the connection is open.
It may change even while the connection is open,
because of an {@link #update update}.
| public org.apache.http.HttpHost | getTargetHost()Obtains the target host for this connection.
If the connection is to a proxy but not tunnelled, this is
the proxy. If the connection is tunnelled through a proxy,
this is the target of the tunnel.
The return value is well-defined only while the connection is open.
It may change even while the connection is open,
because of an {@link #update update}.
| public boolean | isSecure()Indicates whether this connection is secure.
The return value is well-defined only while the connection is open.
It may change even while the connection is open,
because of an {@link #update update}.
| public void | openCompleted(boolean secure, org.apache.http.params.HttpParams params)Signals that the connection has been successfully open.
An attempt to call this method on an open connection will cause
an exception.
| public void | opening(java.net.Socket sock, org.apache.http.HttpHost target)Signals that this connection is in the process of being open.
By calling this method, you can provide the connection with
the unconnected socket that will be connected before
{@link #openCompleted} is called. This allows
the connection to close that socket if
{@link org.apache.http.HttpConnection#shutdown shutdown}
is called before it is open. Closing the unconnected socket
will interrupt a thread that is blocked on the connect.
Otherwise, that thread will either time out on the connect,
or it returns successfully and then opens this connection
which was just shut down.
You also must call {@link #openCompleted} in order to complete
the process
| public void | update(java.net.Socket sock, org.apache.http.HttpHost target, boolean secure, org.apache.http.params.HttpParams params)Updates this connection.
A connection can be updated only while it is open.
Updates are used for example when a tunnel has been established,
or when a TLS/SSL connection has been layered on top of a plain
socket connection.
Note: Updating the connection will not close the
previously used socket. It is the caller's responsibility to close
that socket if it is no longer required.
|
|