public interface ConnectionRequest extends Cancellable
HttpClientConnection的请求,其生命周期由连接管理器管理。
| Modifier and Type | Method and Description |
|---|---|
HttpClientConnection |
get(long timeout, TimeUnit tunit)
在给定时间内获取连接。
|
cancelHttpClientConnection get(long timeout, TimeUnit tunit) throws InterruptedException, ExecutionException, ConnectionPoolTimeoutException
Cancellable.cancel()被阻塞或在此之前被调用,那么InterruptedException将被抛出。
timeout - 超时,0或否为无超时
tunit -为对所述单元
timeout ,可以是
null只有如果没有超时
ConnectionPoolTimeoutException - 超时的情况
InterruptedException - 如果调用线程在等待时中断
ExecutionException
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.