hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "M.Zdila / EpiSoftware Ltd" <m.zd...@episoftware.com>
Subject Re: bandwidth throttling
Date Mon, 18 Sep 2006 19:54:05 GMT
Hi Roland

Thanks for your answer. It has helped me!

I am not using server-relative paths so I'll use ThreadLocal variable :-).

Regards

On Monday 18 September 2006 16:37, Roland Weber wrote:
> Hello Martin,
>
> > I need to throttle HTTP connections to limit bandwidth. Now I can
> > throttle all connections using some protocol by using
> > org.apache.jmeter.protocol.http.util.SlowHttpClientSocketFactory and
> > Protocol.register(). But this is not sufficient to me. What I need is to
> > be able to set different limit before each HttpMethod execution.
>
> If you are using server-relative paths, you can pass the HostConfiguration
> to be used explicitly to HttpClient:
> http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/htt
>pclient/HttpClient.html#executeMethod(org.apache.commons.httpclient.HostConf
>iguration,%20org.apache.commons.httpclient.HttpMethod) In that case, the
> Protocol instance will be taken from the HostConfiguration argument, and
> you can pass in any protocol (and protocol socket factory) you want to be
> used for this method specifically.
>
> Otherwise, there's always the ugly trick of using a ThreadLocal variable
> that is set before calling the execute method and read by the protocol
> socket factory to decide how much to throttle, if at all.
>
> hope that helps,
>   Roland
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

-- 
Martin Zdila
Analyst/Developer

EpiSoftware Slovakia Ltd.
Letna 27, 043 14 Kosice
cellular: +421 908 363 848
phone: +421 55 6770 420
fax: +421 55 6770 420
mailto:m.zdila@episoftware.com
http://www.episoftware.com


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


Mime
View raw message