本文整理了Java中org.eclipse.jetty.client.HttpClient.removeDestination()
方法的一些代码示例,展示了HttpClient.removeDestination()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpClient.removeDestination()
方法的具体详情如下:
包路径:org.eclipse.jetty.client.HttpClient
类名称:HttpClient
方法名:removeDestination
暂无
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public void returnIdleConnection(AbstractHttpConnection connection)
{
// TODO work out the real idle time;
long idleForMs = connection.getEndPoint() != null ? connection.getEndPoint().getMaxIdleTime() : -1;
connection.onIdleExpired(idleForMs);
boolean startConnection = false;
boolean remove = false;
synchronized (this)
{
_idleConnections.remove(connection);
_connections.remove(connection);
if (_exchanges.isEmpty())
remove=_client.isRemoveIdleDestinations() && ( _cookies==null || _cookies.isEmpty() ) &&_connections.isEmpty() && _idleConnections.isEmpty();
else if (_client.isStarted())
startConnection = true;
}
if (startConnection)
startNewConnection();
if (remove)
_client.removeDestination(this);
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
private void tryRemoveIdleDestination()
{
if (getHttpClient().isRemoveIdleDestinations() && connectionPool.isEmpty())
{
// There is a race condition between this thread removing the destination
// and another thread queueing a request to this same destination.
// If this destination is removed, but the request queued, a new connection
// will be opened, the exchange will be executed and eventually the connection
// will idle timeout and be closed. Meanwhile a new destination will be created
// in HttpClient and will be used for other requests.
getHttpClient().removeDestination(this);
}
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
startNewConnection();
if (remove)
_client.removeDestination(this);
内容来源于网络,如有侵权,请联系作者删除!