public final class Connection
extends java.lang.Object
Typically instances of this class are created, connected and exercised automatically by the HTTP client. Applications may use this class to monitor HTTP connections as members of a connection pool.
Do not confuse this class with the misnamed HttpURLConnection
,
which isn't so much a connection as a single request/response exchange.
Constructor and Description |
---|
Connection(ConnectionPool pool,
Route route) |
Modifier and Type | Method and Description |
---|---|
Handshake |
getHandshake() |
Protocol |
getProtocol()
Returns the protocol negotiated by this connection, or
Protocol.HTTP_1_1 if no protocol has been negotiated. |
Route |
getRoute()
Returns the route used by this connection.
|
java.net.Socket |
getSocket()
Returns the socket that this connection uses, or null if the connection
is not currently connected.
|
public Connection(ConnectionPool pool, Route route)
public Route getRoute()
public java.net.Socket getSocket()
public Handshake getHandshake()
public Protocol getProtocol()
Protocol.HTTP_1_1
if no protocol has been negotiated.Copyright © 2014. All Rights Reserved.