You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "linea@libero.it" <li...@libero.it> on 2003/09/11 15:32:47 UTC
MultiThread and setSoTimeout
Hi,
my question is the following: I would like to set different timeouts between
threads..What is the best way to do this?
I can't find any methods to set the timeout except in HttpClient and
HttpConnection. Setting it in HttpClient results in the same timeout for every
connection, and, as executing a method causes a connection to be automatically
allocated by the MultiThreadedHttpConnectionManager, I don't know how to seta
timeout for an already allocated HttpConnection.
A solution could be to use different HttpClients, but this would affect
performances I guess..
Do I miss anything?
Many thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
Re: MultiThread and setSoTimeout
Posted by Ortwin Glück <or...@nose.ch>.
linea@libero.it wrote:
> Hi,
>
> my question is the following: I would like to set different timeouts
> between threads..What is the best way to do this?
You can wait for the new preference architecture to be finished which
shall allow this.
> I can't find any methods to set the timeout except in HttpClient and
> HttpConnection. Setting it in HttpClient results in the same timeout for
> every connection, and, as executing a method causes a connection to be
> automatically allocated by the MultiThreadedHttpConnectionManager, I
> don't know how to seta timeout for an already allocated HttpConnection.
>
> A solution could be to use different HttpClients, but this would affect
> performances I guess..
Only if you connect to the same host from all threads. Otherwise using a
separate Instance of HttpClient for each thread does not affect performance.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org