hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Feng Jiang" <feng.a.ji...@gmail.com>
Subject Re: Is httpclient able to notice me whether the fetching process has been finished?
Date Mon, 11 Jun 2007 09:09:23 GMT
Ok, thanks.

Feng

On 6/11/07, Oleg Kalnichevski <olegk@apache.org> wrote:
>
> On Mon, 2007-06-11 at 16:46 +0800, Feng Jiang wrote:
> > Hi Oleg,
> >
> > thanks alot. but which method does you mean? I read stream in this way:
> > InputStream is = method.getResponseBodyAsStream();
> > is.read(...)
> >
> > Do you mean that I just only need to handle the IOException thrown by
> the
> > InputStream.read() method?
>
> Yes, I do.
>
> > Isn't there any other possibility that httpclient
> > throws IOException not because the conneciton is closed?
> >
>
> There can be other causes for an IOException to be thrown while fetching
> the response body such as malformed chunk encoding but the premature
> termination of the connection by the peer or a connectivity problem are
> the most likely ones.
>
> Oleg
>
>
> > Any way, Thanks a lot.
> >
> > Feng
> >
> > On 6/11/07, Oleg Kalnichevski <olegk@apache.org> wrote:
> > >
> > > On Mon, 2007-06-11 at 15:06 +0800, Feng Jiang wrote:
> > > > Hi all,
> > > >
> > > > I need httpclient to fetching some large files, such as images,
> videos.
> > > In
> > > > some cases, the server will close the connection before the fetching
> > > process
> > > > is done, so that I have only fetched a part of the whole file. In
> this
> > > case,
> > > > I hope httpclient be able to tell me whether it fetched the whole
> file,
> > > or
> > > > interrupted during the fetching process.
> > > >
> > > > Can httpclient do it?
> > > >
> > > > Thanks alot,
> > > >
> > > > Feng
> > >
> > > Hi Feng
> > >
> > > HttpClient will throw an IOException (most likely 'Connection reset by
> > > peer' or some such) if the target server shuts down the connection
> > > prematurely.
> > >
> > > Hope this helps
> > >
> > > Oleg
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message