类 Transmitter
java.lang.Object
com.lark.oapi.okhttp.internal.connection.Transmitter
Bridge between OkHttp's application and network layers. This class exposes high-level application
layer primitives: connections, requests, responses, and streams.
This class supports asynchronous canceling. This is intended to have the smallest blast radius possible. If an HTTP/2 stream is active, canceling will cancel that stream but not the other streams sharing its connection. But if the TLS handshake is still in progress then canceling may break the entire connection.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidvoidcancel()Immediately closes the socket connection if it's currently held.booleancanRetry()voidbooleanbooleanvoidprepareToConnect(Request request) Prepare to create a stream to carryrequest.timeout()voidStops applying the timeout before the call is entirely complete.void
-
字段详细资料
-
connection
-
-
构造器详细资料
-
Transmitter
-
-
方法详细资料
-
timeout
-
timeoutEnter
public void timeoutEnter() -
timeoutEarlyExit
public void timeoutEarlyExit()Stops applying the timeout before the call is entirely complete. This is used for WebSockets and duplex calls where the timeout only applies to the initial setup. -
callStart
public void callStart() -
prepareToConnect
Prepare to create a stream to carryrequest. This prefers to use the existing connection if it exists. -
exchangeDoneDueToException
public void exchangeDoneDueToException() -
noMoreExchanges
-
canRetry
public boolean canRetry() -
hasExchange
public boolean hasExchange() -
cancel
public void cancel()Immediately closes the socket connection if it's currently held. Use this to interrupt an in-flight request from any thread. It's the caller's responsibility to close the request body and response body streams; otherwise resources may be leaked.This method is safe to be called concurrently, but provides limited guarantees. If a transport layer connection has been established (such as a HTTP/2 stream) that is terminated. Otherwise if a socket connection is being established, that is terminated.
-
isCanceled
public boolean isCanceled()
-