in reply to Win32: timing out a perl subroutine

Here is just a few quick thoughts I had. I know you can pass a timeout to things like http requests using LWP on windows. I'm not sure if they work for LWP on windows, but if they do, you can just go look at their code (why reinvent it?). If you installed activestate perl, then you should find that code in c:\Perl\site\lib\LWP unless you installed it custom on your own.

Also, since fork is working on one of the latest perl releases by activestate on win 32 (see my post Re: Threads) you could do what you said and fork off the process, and have the parent poll for the child to return something on the return pipe, or if it didn't do it in time (use could use just use sleep in a loop to poll over certain time intervals) just kill the child. It sounds like you were having problems with forking in win32, so that's why I point out that node. Check out my other nodes at Eradicatore for more on win32 and forking. I've been posting a lot on that lately too.

oh, also look at IO::Socket::INET to see if there is good examples of using timeouts. Again, this may or may not be working on win32, but it's worth a shot to see if they already got this working.

Justin Eltoft

"If at all god's gaze upon us falls, its with a mischievous grin, look at him" -- Dave Matthews

  • Comment on Re: Win32: timing out a perl subroutine