in reply to Re: Workaround of Timeout on https
in thread Workaround of Timeout on https

Hi, thk, in fact i checking the status of $@ but not works too, i'm not use timeout here becouse doesn't work see the report http://rt.cpan.org/Public/Bug/Display.html?id=22839, i see your post but it's from 2001 actually win32 support signal.. i guess... becouse I was used alarm from 5 year with problem....

Thk U very much really

Replies are listed 'Best First'.
Re^3: Workaround of Timeout on https
by starbolin (Hermit) on May 15, 2008 at 16:45 UTC

    Not all processes in the network stack are interruptible. Perl can't process an ALRM signal until control is returned to the perl interpreter. One partial remediation is to break up the task into small chunks. ie. Perform DNS queries first and pinging the server before issuing GETs.

    The only sure 'workaround' is to fork a child to handle the network communication. This allows the parent to time-out and leave the children to the reaper.


    s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}