hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject Re: Question concerning closing http-connections
Date Mon, 03 Apr 2006 12:12:06 GMT
Hi Mathias,

> 
> unfortunately I can't reuse the HttpClient.
> though, I know yours is the better solution...

Then consider reusing the (multi threaded) connection manager.

> --snip--
> client.executeMethod(get);
> ...
> ... = get.getResponseBody();
> ...
> get.releaseConnection();
> client.getHttpConnectionManager().getConnection(get.
> getHostConfiguration()).close();
> --snap--
> 
> it's a bit ugly, but I think it works...

Why don't you add the "connection: close" header
to 'get' before executing? That is almost pretty
and works with any kind of connection manager, not
just the simple one.

cheers,
  Roland




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


Mime
View raw message