Re: timeout problem

Marc Langheinrich (marclang@cs.washington.edu)
Tue, 11 Jan 2000 15:14:45 +0100


> Will this work?  I don't think so.  I am told that LWP's own alarm will
> overrule mine, so that this will not work at all.
The recent LWP modules should not use any "alarm()" anymore (nor does PUA),
for exactly those reasons (i.e. not to interfere with custom alarms).
Instead, you can specify if you want to have LWP (or PUA) handle "die"s or
if you'd rather do this yourself:

  $ua->use_eval(1); # catch die's for me (this is the default)

This way, you could for example set an alarm before you call $ua->request
and then have your program die() in your SIGARLM subroutine. Since LWP will
catch those dies, you'll get a nice response object containing the text of
your die() (like "Custom timeout after 30 seconds").

-m
-- 
Marc Langheinrich
marclang@cs.washington.edu