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 dh...@lexmark.com on 2005/01/24 21:04:33 UTC

Any equivalent to setReuseAddress() to true - ie reuse sockets in TIME_WAIT state

Hi,

I am creating alot of connections to Tomcat 5 using HttpClient.  As a
result, I have a lot of sockets in the TIME_WAIT state, which lead to a
BindException - Connection In use.

Is there any way to get the HttpClient to reuse these sockets akin to using
setReuseAddress(true) when using a plain socket?

Any other suggestions?

cheers,

David




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


Re: Any equivalent to setReuseAddress() to true - ie reuse sockets in TIME_WAIT state

Posted by Oleg Kalnichevski <ol...@apache.org>.
David,

What kind of connection manager are you using? If yes, consider using
the so called multithreaded connection manager that maintains a pool of
connections:

http://jakarta.apache.org/commons/httpclient/3.0/threading.html

Hope this helps,

Oleg

On Mon, 2005-01-24 at 15:04 -0500, dhay@lexmark.com wrote: 
> Hi,
> 
> I am creating alot of connections to Tomcat 5 using HttpClient.  As a
> result, I have a lot of sockets in the TIME_WAIT state, which lead to a
> BindException - Connection In use.
> 
> Is there any way to get the HttpClient to reuse these sockets akin to using
> setReuseAddress(true) when using a plain socket?
> 
> Any other suggestions?
> 
> cheers,
> 
> David
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 


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