public final class StreamAllocation extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
StreamAllocation.StreamAllocationReference |
| Modifier and Type | Field and Description |
|---|---|
Address |
address |
NewCall |
call |
EventListener |
eventListener |
| Constructor and Description |
|---|
StreamAllocation(ConnectionPool connectionPool,
Address address,
NewCall call,
EventListener eventListener,
Object callStackTrace) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquire(RealConnection connection,
boolean reportedAcquired)
使用这个分配来保存
connection。每个对它的调用必须与
对同一连接上的release()的调用配对 |
void |
cancel() |
HttpCodec |
codec() |
RealConnection |
connection() |
boolean |
hasMoreRoutes() |
HttpCodec |
newStream(Httpd client,
Interceptor.Chain chain,
boolean doExtensiveHealthChecks) |
void |
noNewStreams()
禁止在承载此分配的连接上创建新流
|
void |
release() |
Socket |
releaseAndAcquire(RealConnection newConnection)
释放该连接持有的连接,并获取
newConnection。只有在持有的
连接是新连接,但是被newConnection复制时,调用它才是安全
的。通常在并发连接到HTTP/2 webserver时发生这种情况
返回一个关闭选项,调用者应该在同步块完成*时将其传递给IoUtils.close(Socket) |
Route |
route() |
void |
streamFailed(IOException e) |
void |
streamFinished(boolean noNewStreams,
HttpCodec codec,
long bytesRead,
IOException e) |
String |
toString() |
public final Address address
public final NewCall call
public final EventListener eventListener
public StreamAllocation(ConnectionPool connectionPool, Address address, NewCall call, EventListener eventListener, Object callStackTrace)
public HttpCodec newStream(Httpd client, Interceptor.Chain chain, boolean doExtensiveHealthChecks)
public void streamFinished(boolean noNewStreams,
HttpCodec codec,
long bytesRead,
IOException e)
public HttpCodec codec()
public Route route()
public RealConnection connection()
public void release()
public void noNewStreams()
public void cancel()
public void streamFailed(IOException e)
public void acquire(RealConnection connection, boolean reportedAcquired)
connection。每个对它的调用必须与
对同一连接上的release()的调用配对connection - 连接信息reportedAcquired - 是否已经取得报告public Socket releaseAndAcquire(RealConnection newConnection)
newConnection。只有在持有的
连接是新连接,但是被newConnection复制时,调用它才是安全
的。通常在并发连接到HTTP/2 webserver时发生这种情况
返回一个关闭选项,调用者应该在同步块完成*时将其传递给IoUtils.close(Socket)newConnection - 新连接信息public boolean hasMoreRoutes()
Copyright © 2020. All rights reserved.