Hi Ortwin,

> Guillaume Cottenceau wrote:
> > If, for example, the HTTP server sends one "a" byte once per
> > second forever, HttpClient will never exit from executeMethod -
> > if I'm correct.
> 
> Yes. It's up to you to decide if that sort of communication makes
> sense. HTTP allows it however.

It seems that httpclient 2.0 doesn't allow doing such a thing
(aborting a receival from a runaway server)? We're using "stable"
httpclient currently.

> >>receiving data), your application should be able to figure out if it
> >>is legitimate to stay open for such a long time and otherwise just
> >>abort the method.
> > There's no such thing available in HttpClient, as far as I know?
> 
> What 'thing'? Abort? see HttpMethod#abort in 3.0

I was assuming stable httpclient, sorry to not making it clear
before.
 
> > This needs a monitor Thread setting a timeout in our application.
> 
> You call
> try {
>   client.execute(method)
>   s = method.getResponseAsStream
>   try {
>    processStream(s)
>   } catch(MyException) {
>     method.abort();
>   }
> } finally {
>    method.releaseConnection();
> }

I can't say for 3.0 but in 2.0 it seems that client.execute is
blocked until the server finishes sending the headers (does make
sense because executeMethod returns the HTTP response code). In
my upper example (a server not sending any actual header) your
code excerpt is blocked forever, if I'm correct.

> > It could make sense to implement this timeout in HttpClient, as
> > I've said in previous mail, however I am not sure it is "allowed"
> > by the HTTP protocol.
> 
> No it doesn't. HttpClient doesn't care what you send over the wire,
> and it does not care how fast you are doing this either, because HTTP
> does not specify that of course. Your problem is completely in the
> application domain and not in the protocol domain.

I see. HttpClient uses socket timeouts for data transfer
timeouts, following your reasoning this is in the HTTP protocol?

-- 
Guillaume Cottenceau

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to