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 08:55:55 GMT
Hello Mathias,

> After executing the GetMethod with the client I fetch the responseBody 
> via getResponseBody() and then I call closeIdleConnections() with a 
> timeout of 15s on the corresponding HttpConnectionManger. After that I 
> call releaseConnection() on the GetMethod-Object.
> Question: Is the Connection that was used closed after that or does it 
> remain open?

It remains open.

> If it remains open, how can I close it?

Several options:
1. send a "Connection: close" header with the request
2. call closeIdleConnections() *after* releasing the connection
   and/or with a lower timeout
3. implement a connection manager that always closes connections

hope that helps,

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

View raw message