public final class RealConnection extends Object implements Connection
Modifier and Type | Field and Description |
---|---|
List<Reference<StreamAllocation>> |
allocations |
FramedConnection |
framedConnection |
long |
idleAtNanos |
boolean |
noNewStreams |
okio.BufferedSink |
sink |
Socket |
socket
The application layer socket.
|
okio.BufferedSource |
source |
int |
streamCount |
Constructor and Description |
---|
RealConnection(Route route) |
Modifier and Type | Method and Description |
---|---|
int |
allocationLimit() |
void |
cancel() |
void |
connect(int connectTimeout,
int readTimeout,
int writeTimeout,
List<ConnectionSpec> connectionSpecs,
boolean connectionRetryEnabled) |
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.
|
Socket |
getSocket()
Returns the socket that this connection uses, or null if the connection
is not currently connected.
|
boolean |
isHealthy(boolean doExtensiveChecks)
Returns true if this connection is ready to host new streams.
|
boolean |
isMultiplexed()
Returns true if this is a SPDY connection.
|
String |
toString() |
public Socket socket
public volatile FramedConnection framedConnection
public int streamCount
public okio.BufferedSource source
public okio.BufferedSink sink
public final List<Reference<StreamAllocation>> allocations
public boolean noNewStreams
public long idleAtNanos
public RealConnection(Route route)
public void connect(int connectTimeout, int readTimeout, int writeTimeout, List<ConnectionSpec> connectionSpecs, boolean connectionRetryEnabled) throws RouteException
RouteException
public Route getRoute()
Connection
getRoute
in interface Connection
public void cancel()
public Socket getSocket()
Connection
getSocket
in interface Connection
public int allocationLimit()
public boolean isHealthy(boolean doExtensiveChecks)
public Handshake getHandshake()
getHandshake
in interface Connection
public boolean isMultiplexed()
public Protocol getProtocol()
Connection
Protocol.HTTP_1_1
if no protocol
has been negotiated. This method returns Protocol.HTTP_1_1
even if the remote peer is
using Protocol.HTTP_1_0
.getProtocol
in interface Connection
Copyright © 2016. All rights reserved.