@Immutable public class DefaultConnectionKeepAliveStrategy extends java.lang.Object implements ConnectionKeepAliveStrategy
| 限定符和类型 | 字段和说明 |
|---|---|
static DefaultConnectionKeepAliveStrategy |
INSTANCE |
| 构造器和说明 |
|---|
DefaultConnectionKeepAliveStrategy() |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getKeepAliveDuration(HttpResponse response,
HttpContext context)
Returns the duration of time which this connection can be safely kept
idle.
|
public static final DefaultConnectionKeepAliveStrategy INSTANCE
public long getKeepAliveDuration(HttpResponse response, HttpContext context)
ConnectionKeepAliveStrategyConnectionReuseStrategy, if
ConnectionReuseStrategy.keepAlive(
HttpResponse, HttpContext) returns true, this allows you to control
how long the reuse will last. If keepAlive returns false, this should
have no meaningful impactgetKeepAliveDuration 在接口中 ConnectionKeepAliveStrategyresponse - The last response received over the connection.context - the context in which the connection is being used.