public final class RealConnection extends Http2Connection.Listener implements Connection
| 限定符和类型 | 字段和说明 |
|---|---|
RealConnectionPool |
connectionPool |
REFUSE_INCOMING_STREAMS| 构造器和说明 |
|---|
RealConnection(RealConnectionPool connectionPool,
Route route) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel() |
void |
connect(int connectTimeout,
int readTimeout,
int writeTimeout,
int pingIntervalMillis,
boolean connectionRetryEnabled,
Call call,
EventListener eventListener) |
Handshake |
handshake()
Returns the TLS handshake used to establish this connection, or null if the connection is not
HTTPS.
|
boolean |
isHealthy(boolean doExtensiveChecks)
Returns true if this connection is ready to host new streams.
|
boolean |
isMultiplexed()
Returns true if this is an HTTP/2 connection.
|
void |
noNewExchanges()
Prevent further exchanges from being created on this connection.
|
void |
onSettings(Http2Connection connection)
When settings are received, adjust the allocation limit.
|
void |
onStream(Http2Stream stream)
Refuse incoming streams.
|
Protocol |
protocol()
Returns the protocol negotiated by this connection, or
Protocol.HTTP_1_1 if no protocol
has been negotiated. |
Route |
route()
Returns the route used by this connection.
|
Socket |
socket()
Returns the socket that this connection is using.
|
boolean |
supportsUrl(HttpUrl url) |
String |
toString() |
public final RealConnectionPool connectionPool
public RealConnection(RealConnectionPool connectionPool, Route route)
public void noNewExchanges()
public void connect(int connectTimeout,
int readTimeout,
int writeTimeout,
int pingIntervalMillis,
boolean connectionRetryEnabled,
Call call,
EventListener eventListener)
public boolean supportsUrl(HttpUrl url)
public Route route()
Connectionroute 在接口中 Connectionpublic void cancel()
public Socket socket()
Connectionsocket 在接口中 Connectionpublic boolean isHealthy(boolean doExtensiveChecks)
public void onStream(Http2Stream stream) throws IOException
onStream 在类中 Http2Connection.ListenerIOExceptionpublic void onSettings(Http2Connection connection)
onSettings 在类中 Http2Connection.Listenerpublic Handshake handshake()
Connectionhandshake 在接口中 Connectionpublic boolean isMultiplexed()
public Protocol protocol()
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.protocol 在接口中 ConnectionCopyright © 2025. All rights reserved.