You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Eric wais <wa...@gmail.com> on 2010/06/17 10:47:57 UTC

HttpClient Connections

I have an application which needs to make requests to another application
and am using HttpClient to do this. My application will have multiple users
at once using the application. The application that I need to connect to is
in the form of a wizard with about 5 pages in this wizard which are all
GET's. I reuse the DefaultHttpClient client for each GET and works. The
obvious would be to shutdown the connection on the final GET. But what
happens if the user for some reason decides not to go through the entire
wizard and does not reach the final page?

What is the effect of not shutting down the connection. Is there a way to
timeout the connection? Does the connection shutdown when the session ends?

Re: HttpClient Connections

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2010-06-17 at 10:47 +0200, Eric wais wrote:
> I have an application which needs to make requests to another application
> and am using HttpClient to do this. My application will have multiple users
> at once using the application. The application that I need to connect to is
> in the form of a wizard with about 5 pages in this wizard which are all
> GET's. I reuse the DefaultHttpClient client for each GET and works. The
> obvious would be to shutdown the connection on the final GET. But what
> happens if the user for some reason decides not to go through the entire
> wizard and does not reach the final page?
> 

HttpClient will automatically consume and discard the remaining content
when the content stream is closed. 


> What is the effect of not shutting down the connection.

The connection will be returned to the pool if it can be kept-alive.

>  Is there a way to
> timeout the connection? 

Yes.

> Does the connection shutdown when the session ends?

No.

Oleg


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