hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Becke" <mbe...@gmail.com>
Subject Re: [HttpConn] manager
Date Sun, 21 Jan 2007 18:20:09 GMT
> I got it. When being allocated, the connection was counted
> for the "connections per host" limit. When it is released,
> some other thread waiting for a connection to that host can
> be unblocked. We need to remember the host configuration
> for which the connection was allocated to uncount it when
> it gets released.

That is correct.

> I guess there is not even an unspecific list? Connections
> are kept in two lists simultaneously, one is always host
> specific while the other one keeps all connections in the
> pool. Currently, connections are never re-assigned to a
> different host, but instead they are deleted and a new
> connection is created for the new host.

It does keep a list of freeConnections (for the purpose of deleting a
least recently used connection).  This only occurs when the host limit
_has not_ been reached, the total allocated connection limit _has_
been reached, and there are free connections.  As you say though a
connection is never switched between hosts, it is just deleted and a
new one is created.

> I was a bit confused that HttpMethodDirector updates a
> HostConfiguration when following redirects, but that is
> not the HostConfiguration stored in the connection.

Yes, this is one of the strange "features" of the connection manager.
The current limits on connections per host (route really) are only
enforced at checkout time.  Once a connection is outside of the
connection manager it can be reused for other hosts.


To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org

View raw message