W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2004

Re: timeouts

From: Brian G. Rhodes <brhodes@visualcircuits.com>
Date: Tue, 28 Sep 2004 13:11:27 -0500
To: Erik Lotspeich <erik@lotspeich.org>
Cc: www-lib@w3.org
Message-Id: <1096395087.1441.7.camel@bugs.visualcircuits.>

Erik,

Yeah, I actually figured out the problem after turning tracing on.  If I
create a preemptive client, I cannot later set preemptive to off which
will create a non-blocking socket.  I used newNoCacheClient and now it's
working as I desired.

Btw, I believe HTHost_setEventTimeout is in milliseconds.

On Tue, 2004-09-28 at 17:50 +0000, Erik Lotspeich wrote:
> Brian,
> 
> I'm using this function:
> 
>          /* Setup a timeout on the request for 5 secs */
>          HTHost_setEventTimeout(5);
> 
> The time is specified in seconds.
> 
> Hope this helps,
> 
> Erik.
> 
> On Sat, 25 Sep 2004, Brian G. Rhodes wrote:
> 
> >
> > Is there a way to control the timeout on retrieving a file such as
> > HTLoadToFile.
> >
> > HTRequest *request = 0;
> >  struct     stat fstat;
> >
> >  request = HTRequest_new();
> >  HTAlert_setInteractive(NO);
> >
> >  HTRequest_addConnection(request, "close", "");
> >
> >  debug("libwww.c", "saving %s to %s...\n", src, dst);
> >
> >  if ((HTLoadToFile(src, request, dst) != YES))
> >    {
> >      debug("libwww.c", "cannot download file %s\n", src);
> >      return 0;
> >    }
> >
> >  debug("libwww.c", "request loop\n");
> >  HTEventList_loop(request);
> >
> >  stat(dst, &fstat);
> >  debug("libwww.c", "saved %s (%llu bytes)\n", src, fstat.st_size);
> >
> >  if (access(dst, F_OK) || !(fstat.st_size))
> >    return 0;
> >
> >  HTRequest_delete(request);
> >  return fstat.st_size;
> >
> > HTHost_setEventTimeout does not seem to affect this.  I would like to
> > limit the attempt to a couple seconds.  That timeout is fine once the
> > event loop runs, but HTLoadToFile is blocking for about 60 seconds.
> > What am I missing?
> >
> >
> >
> >
Received on Tuesday, 28 September 2004 18:12:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:44 GMT