public final class Transmitter extends Object
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.
| 限定符和类型 | 字段和说明 |
|---|---|
RealConnection |
connection |
| 构造器和说明 |
|---|
Transmitter(OkHttpClient client,
Call call) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
callStart() |
void |
cancel()
Immediately closes the socket connection if it's currently held.
|
boolean |
canRetry() |
void |
exchangeDoneDueToException() |
boolean |
hasExchange() |
boolean |
isCanceled() |
IOException |
noMoreExchanges(IOException e) |
void |
prepareToConnect(Request request)
Prepare to create a stream to carry
request. |
Timeout |
timeout() |
void |
timeoutEarlyExit()
Stops applying the timeout before the call is entirely complete.
|
void |
timeoutEnter() |
public RealConnection connection
public Transmitter(OkHttpClient client, Call call)
public Timeout timeout()
public void timeoutEnter()
public void timeoutEarlyExit()
public void callStart()
public void prepareToConnect(Request request)
request. This prefers to use the existing
connection if it exists.public void exchangeDoneDueToException()
@Nullable public IOException noMoreExchanges(@Nullable IOException e)
public boolean canRetry()
public boolean hasExchange()
public void cancel()
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.
public boolean isCanceled()
Copyright © 2024. All rights reserved.