Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Browser Timeout

by Rhandom (Curate)
on Jun 13, 2001 at 19:24 UTC ( #88086=note: print w/replies, xml ) Need Help??

in reply to Browser Timeout

There is another way. (Probably easier to). Apache and the browser won't time out as long as data is being sent. So send some data...

#!/usr/bin/perl $| = 1; # thousands of ways to do this print "Content-type: text/html\n\n"; ### set up an alarm my $timeout = 4*60; # apache normally times out after 5 min print "<!--\n"; # hide output $SIG{ALRM} = sub{ print ".\n"; alarm($timeout); }; # the timeout will send something to the browser every # now and then to keep it from timing out alarm($timeout); &do_something_heinous(); alarm(0); print "-->\n"; # don't need to hide output anymore print "All done\n"; exit; sub do_something_heinous { sleep(6 * 60); }

My company actually has a module that we can use to wrap around this. It works great. (Actually, I typed this code in from memory -- our servers are down from a storm -- hope it compiles, but the idea should be intact).

my @a=qw(random brilliant braindead); print $a[rand(@a)];

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://88086]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2020-10-26 01:38 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (249 votes). Check out past polls.