Hello Jeremy,

releasing a connection and closing a connection are two different
things. A connection always has to be released by the application,
so it can be used again for another request. Releasing a connection
means giving it back to the pool.

Closing a connection has to do with keep-alive. A connection can
be re-used without being closed, or it can be re-used after being
closed. In the latter case, it will be re-opened. The former is
possible only if the next request is sent to the same host. If not,
even the connection that was kept alive will be closed, before
being reopened to a different host.

You don't touch the releaseConnection method in BasicHttpMethod
or any other *Method class, because all it does is to give the
connection back to the pool. And that's something that has to be
done anyway.

You change the releaseConnection method in the pool implementation
because every connection being given back to the pool will pass
through that method. That gives you the opportunity to do something
with it, for example to close it. Since you are still seeing short
SSL handshakes instead of full ones, there are two reasons I can
think of right now:

1) you made some minor mistake when implementing the modified
   pool (connection manager), so the code that closes the
   connection is not executed

2) your SSL implementation maintains a pool of SSL sockets which
   is different from the pool of HttpConnections maintained by
   HttpClient, or rather by your modified connection manager

I suggest you investigate these reasons in the order given.
I'd add some debug output to the changed method in the connection
manager. A small typo, for example in the method name, will
still leave valid Java code, but breaks the overriding of the
base class method and bypasses your modifications. If that is
not the problem, you'll have to dig deep into the documentation
of your SSL/JSSE implementation before modifying the
SecureProtocolSocketFactory you're using.

hope that helps,
  Roland



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to