hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <adrian.sut...@ephox.com>
Subject RE: CRLF and Connection: close
Date Thu, 20 Mar 2003 22:52:55 GMT
Hi Carl,
I believe that you are correct in the assumption that HttpClient is holding
the connection open for HTTP1.1, the best way to deal with this that I can
see is to write your own connection manager that extends whichever
connection manager you wanted to use and override the method that adds the
connection back into the pool and instead close the connection and discard
it.

I was going to write documentation on how to supply a custom connection
manager but couldn't think of a reason why anyone would want to, guess we
just found one. :)  Any example code or caveats you find along this would
(if you decide to take it) would be good to hear about.

Of course, as Oleg pointed out, Mike Beck is the absolute authority on all
this so listen to him over me. :)

Adrian Sutton, Software Engineer
Ephox Corporation
www.ephox.com


-----Original Message-----
From: Carl A. Dunham [mailto:httpc@strategyforward.com]
Sent: Friday, 21 March 2003 8:46 AM
To: Commons HttpClient Project
Subject: Re: CRLF and Connection: close


Simon,

On Thursday March 20 2003 17:27, Simon Roberts wrote:
> Are you calling HttpMethod.releaseConnection once you've finished with
> each HttpMethod?  If you don't do that, HttpClient will hold the
> connections until a garbage-collect reaps the connections.

Yes, but as I read it, this only returns it to the connectionPool, leaving
the 
connection physically still open. The actual system connection does not seem

be freed until the next gc, presumably (and I seem to recall that being 
unreliable in Java in the past, although that might be ancient history). 
Unless I'm just missing it.

> That doesn't sound like the same problem. Which version are you running?
> There
> have been some recent changes with the way timeouts are dealt with.

This is ALPHA3. I will try the latest CVS version and see if it behaves the 
same way.

>
> Cheers, Simon
>

Thanks!

Carl


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


Mime
View raw message