hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Connection Reuse.
Date Sun, 03 May 2009 11:47:23 GMT
Keean Schupke wrote:
> Hi,
> 
> I searched for old posts on this topic, but none seem to cover my case
> exactly. I suspect I am dealing with a non-standard webserver.
> However, a telnet to  the server on port 80 allows several HTTP
> commands to be run before the server closes the connection (at least 6
> if they succeed).
> 
> So, I want to force the client to keep an SSL connection open and
> re-use it. For now I am happy to catch an exception if the server has
> closed the connection.
> 
> To give me an idea of what is going on I implemented a decorator for
> the ClientConnectionManager and the SSLSocketFactory, logging the
> method calls to a debug log.
> 
> Every time we try and execute a query on the server, the following
> calls are made:
> 
> ClientConnectionManager.requestConnection(...)
> SSLSocketFactory.createSocket()
> SSLSockerFactory.connectSocket(...)
> 
> I have tried:
> 
> HttpConnectionParams.setStaleCheckingEnabled(httpParams, false);
> 
> But this seems to have no effect.
> 
> How can I force the HttpClient to reuse the connections?
> 

There is no point forcing the client to keep a connection open if the 
server is not going to do likewise. Per default HttpClient tries to 
reuse every connection that can be reused.

You need to find out why HttpClient considers those connections 
non-reusable. Turn on wire/context logging as described here [1] and 
post the log to this list.

Oleg

[1] http://hc.apache.org/httpcomponents-client/logging.html


> Regards,
> Keean.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message