My Other Cgi Snippets :
- time_out_alarm.pl - Snippet
ready to run as Cgi Script . It shows the timeout using alarm function
Here we assign handler TIME_ALARM to the $Sig{ALRM}, before we start printing
a message every 1 sec, we start "alarm 10". and when the clock
goes off it sends SIGALRM to the process, Process catches the sig and starts
the appropriate handler stopping what he was doing before
- time_out_fork.pl - Snippet
ready to run as Cgi Script . This is the snippet of code to show the timeout
using fork and SIGHCLD Here we assign handler TIME_ALARM to the $Sig{CHLD}
and make fork. Child sleeps for the 10 seconds and exits . When child dies
he sends SIGCHLD to the parent process, Parent catches the signal and starts
the appropriate handler stopping what he was doing before