-
- All Implemented Interfaces:
-
com.mobwith.httpmodule.Connection
public final class RealConnection extends Http2Connection.Listener implements Connection
-
-
Field Summary
Fields Modifier and Type Field Description public booleannoNewStreamspublic intsuccessCountpublic intallocationLimitpublic final List<Reference<StreamAllocation>>allocationspublic longidleAtNanos
-
Constructor Summary
Constructors Constructor Description RealConnection(ConnectionPool connectionPool, Route route)
-
Method Summary
Modifier and Type Method Description static RealConnectiontestConnection(ConnectionPool connectionPool, Route route, Socket socket, long idleAtNanos)voidconnect(int connectTimeout, int readTimeout, int writeTimeout, int pingIntervalMillis, boolean connectionRetryEnabled, Call call, EventListener eventListener)booleanisEligible(Address address, @Nullable() Route route)Returns true if this connection can carry a stream allocation to {@code address}.booleansupportsUrl(HttpUrl url)HttpCodecnewCodec(MobonOkHttpClient client, Interceptor.Chain chain, StreamAllocation streamAllocation)RealWebSocket.StreamsnewWebSocketStreams(StreamAllocation streamAllocation)Routeroute()Returns the route used by this connection. voidcancel()Socketsocket()Returns the socket that this connection is using. booleanisHealthy(boolean doExtensiveChecks)Returns true if this connection is ready to host new streams. voidonStream(Http2Stream stream)Refuse incoming streams. voidonSettings(Http2Connection connection)When settings are received, adjust the allocation limit. Handshakehandshake()Returns the TLS handshake used to establish this connection, or null if the connection is notHTTPS. booleanisMultiplexed()Returns true if this is an HTTP/2 connection. Protocolprotocol()Returns the protocol negotiated by this connection, or HTTP_1_1 if no protocolhas been negotiated. StringtoString()-
-
Constructor Detail
-
RealConnection
RealConnection(ConnectionPool connectionPool, Route route)
-
-
Method Detail
-
testConnection
static RealConnection testConnection(ConnectionPool connectionPool, Route route, Socket socket, long idleAtNanos)
-
connect
void connect(int connectTimeout, int readTimeout, int writeTimeout, int pingIntervalMillis, boolean connectionRetryEnabled, Call call, EventListener eventListener)
-
isEligible
boolean isEligible(Address address, @Nullable() Route route)
Returns true if this connection can carry a stream allocation to
{@code address}. If non-null{@code route}is the resolved route for a connection.
-
supportsUrl
boolean supportsUrl(HttpUrl url)
-
newCodec
HttpCodec newCodec(MobonOkHttpClient client, Interceptor.Chain chain, StreamAllocation streamAllocation)
-
newWebSocketStreams
RealWebSocket.Streams newWebSocketStreams(StreamAllocation streamAllocation)
-
cancel
void cancel()
-
socket
Socket socket()
Returns the socket that this connection is using. Returns an SSL socket if this connection is HTTPS. If this is an HTTP/2connection the socket may be shared by multiple concurrent calls.
-
isHealthy
boolean isHealthy(boolean doExtensiveChecks)
Returns true if this connection is ready to host new streams.
-
onStream
void onStream(Http2Stream stream)
Refuse incoming streams.
-
onSettings
void onSettings(Http2Connection connection)
When settings are received, adjust the allocation limit.
-
handshake
Handshake handshake()
Returns the TLS handshake used to establish this connection, or null if the connection is notHTTPS.
-
isMultiplexed
boolean isMultiplexed()
Returns true if this is an HTTP/2 connection. Such connections can be used in multiple HTTPrequests simultaneously.
-
protocol
Protocol protocol()
Returns the protocol negotiated by this connection, or HTTP_1_1 if no protocolhas been negotiated. This method returns HTTP_1_1 even if the remote peer isusing HTTP_1_0.
-
-
-
-