public final class RealConnection extends Http2Connection.Listener implements Connection
| Modifier and Type | Field and Description |
|---|---|
int |
allocationLimit
The maximum number of concurrent streams that can be carried by this connection.
|
List<Reference<StreamAllocation>> |
allocations
Current streams carried by this connection.
|
long |
idleAtNanos
Nanotime timestamp when
allocations.size() reached zero. |
boolean |
noNewStreams
If true, no new streams can be created on this connection.
|
int |
successCount |
REFUSE_INCOMING_STREAMS| Constructor and Description |
|---|
RealConnection(ConnectionPool connectionPool,
Route route) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
void |
connect(int connectTimeout,
int readTimeout,
int writeTimeout,
int pingIntervalMillis,
boolean connectionRetryEnabled,
Call call,
EventListener eventListener) |
Handshake |
handshake() |
boolean |
isEligible(Address address,
Route route) |
boolean |
isHealthy(boolean doExtensiveChecks) |
boolean |
isMultiplexed() |
HttpCodec |
newCodec(Client client,
Interceptor.Chain chain,
StreamAllocation streamAllocation) |
RealWebSocket.Streams |
newWebSocketStreams(StreamAllocation streamAllocation) |
void |
onSettings(Http2Connection connection) |
void |
onStream(Http2Stream stream) |
Protocol |
protocol() |
Route |
route() |
Socket |
socket() |
boolean |
supportsUrl(Url url) |
static RealConnection |
testConnection(ConnectionPool connectionPool,
Route route,
Socket socket,
long idleAtNanos) |
String |
toString() |
public final List<Reference<StreamAllocation>> allocations
public boolean noNewStreams
public int successCount
public int allocationLimit
allocations.size() < allocationLimit then new streams can be created on this connection.public long idleAtNanos
allocations.size() reached zero.public RealConnection(ConnectionPool connectionPool, Route route)
public static RealConnection testConnection(ConnectionPool connectionPool, Route route, Socket socket, long idleAtNanos)
public void connect(int connectTimeout,
int readTimeout,
int writeTimeout,
int pingIntervalMillis,
boolean connectionRetryEnabled,
Call call,
EventListener eventListener)
public boolean supportsUrl(Url url)
public HttpCodec newCodec(Client client, Interceptor.Chain chain, StreamAllocation streamAllocation) throws SocketException
SocketExceptionpublic RealWebSocket.Streams newWebSocketStreams(StreamAllocation streamAllocation)
public Route route()
route in interface Connectionpublic void cancel()
public Socket socket()
socket in interface Connectionpublic boolean isHealthy(boolean doExtensiveChecks)
public void onStream(Http2Stream stream) throws IOException
onStream in class Http2Connection.ListenerIOExceptionpublic void onSettings(Http2Connection connection)
onSettings in class Http2Connection.Listenerpublic Handshake handshake()
handshake in interface Connectionpublic boolean isMultiplexed()
public Protocol protocol()
protocol in interface ConnectionProtocol.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.Copyright © 2019. All rights reserved.