@Contract(threading=IMMUTABLE) public class DefaultConnectionKeepAliveStrategy extends Object implements ConnectionKeepAliveStrategy
| Modifier and Type | Field and Description |
|---|---|
static DefaultConnectionKeepAliveStrategy |
INSTANCE |
| Constructor and Description |
|---|
DefaultConnectionKeepAliveStrategy() |
| Modifier and Type | Method and Description |
|---|---|
long |
getKeepAliveDuration(HttpResponse response, HttpContext context)
返回此连接可以安全保持空闲的持续时间。
|
public static final DefaultConnectionKeepAliveStrategy INSTANCE
public long getKeepAliveDuration(HttpResponse response, HttpContext context)
ConnectionKeepAliveStrategy复制
ConnectionReuseStrategy时 ,如果ConnectionReuseStrategy.keepAlive( HttpResponse, HttpContext)返回true,则允许您控制重用将持续多长时间。
如果keepAlive返回false,则应该没有任何有意义的影响
getKeepAliveDuration在界面
ConnectionKeepAliveStrategy
response - 通过连接收到的最后一个响应。
context - 正在使用连接的上下文。
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.