commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <>
Subject Re: [HttpClient] getting the http connection or setting the params
Date Fri, 08 Oct 2004 01:35:28 GMT
Hi Gustavo,

Not sure what you mean by "setting the connection parameters".  All 
timeout params available on the connection are configurable via some 
HttpClient param.  Which timeout do you want to set?

Though it is possible to get access to the actual connection it is 
highly discouraged.

It sounds like you may want a method to abort a request after some 
time.  HttpClient does not have a built-in "request timeout" param, but 
it can be simulated.  You would need a thread separate from the one 
executing the method that keeps track of the method execution time.  If 
it went over a timeout value you could call HttpMethod.abort().


On Oct 7, 2004, at 6:17 PM, Gustavo Hexsel wrote:

>   I'm using HttpClient to read a variable number of pages in sequence. 
>  I
> have a "time frame" by which the page accesses (method execution and 
> all the
> input stream reads) have to be done.  I tried calling
> method.getParams().setSoTimeout(remainingTime)
>   but it only sets the timeout once, just before opening the 
> connection.  Is
> there a way of getting the http connection behind an executing http 
> method?
> Or setting the connection parameters?
>   Thank you!
>     []s Gustavo
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message