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 Andres Rangel <an...@corp.moniker.com> on 2010/10/07 17:11:05 UTC

Miltiple Independent connection to the same Host

Hi,

I am in the process of  redesigning a multithreaded application that is
doing XML over http  using httpclient vr 4

 

We currently have a pool of threads, and each one opens and closes the
connection all the time (we are using commons-http)

 

We have a restriction of X number of request per connection before
closing it (which we have ignored, since we are opening and closing it
all the time)

 

My question is the following:

 

I know that using ThreadSafeClientConnManager the client can be shared
across multiple threads, but is not the case here, since each thread
will have it's own connection.

 

How can I reuse the connection in each thread?

 

Do I keep the HttpClient in a local variable and just reuse it inside
each thread?

Thanks

 

Andres Rangel


Re: Miltiple Independent connection to the same Host

Posted by Antonio Sánchez <in...@gmail.com>.
> I know that using ThreadSafeClientConnManager the client can be shared
> across multiple threads, but is not the case here, since each thread
> will have it's own connection.
> How can I reuse the connection in each thread?
> 
> Do I keep the HttpClient in a local variable and just reuse it inside
> each thread?

Might help this thread: 

http://marc.info/?t=128640014700007&r=1&w=2






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