<rummages through docs> aha...yes...it uses 'alarm' to implement timeouts. We're on the right track.
The activestate docs tell us that 'alarm' is not supported in their Win32 port.
A (very) quick look at the LWP::UserAgent.pm code on the Activestate build seem to show that the calls to alarm have been stripped out.
So it seems as though you won't have this functionality in the Win32 port of this module without more effort.
Can anyone confirm this?
In the meantime, off the top of my head I can only think that the way to get his would be:
- run the UserAgent as a sub-process using Win32::Process (this would be quite icky...you still have to pass the result back to your parent)
- use the ->Wait() method on the 'process object' returned, to sleep until your timeout expires or the subprocess exits
- kill the subprocess if the ->Wait returned the code which means "process still running"
For bonus style points, wrap this functionality up in the module so the 'timeout' behaves the same as on UNIX and send a patch to the maintainer. :-)
Hope someone else can come up with a better solution.
In reply to Re: HTTP timeout problems
by jbert
in thread HTTP timeout problems
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |