I have a script that is called from the cgi page to be ran on a remote machine, results of which are displayed in the html page it's self.
On the cgi page I have $| = 1 and am using telnet module with Timeout set to 700, since the remote script can take quite some time to finish.
The problem is that the cgi page just hangs while the remote script has completed execution and most or time takes about 600-650 seconds. This does not happen on all remote machines, only the ones that take quite a while for the remote script to complete.
Any ideas?
On the cgi page I have $| = 1 and am using telnet module with Timeout set to 700, since the remote script can take quite some time to finish.
Code:
#!/path/to/perl
use CGI;
use CGI::Carp('fatalToBrowser');
use CGI(:/standard/);
$| = 1;
$remoteHost = param('remoteHostIp');
chomp ($remoteHost);
print "$remoteHost;
&postCheck();
sub postCheck() {
$tlOp = new Net::Telnet(Timeout=>700);
....
@targetdata = $tlOp->cmd("runRemoteScript");
if (@targetdata) {
print "@targetdata";
} else {
print "What Happened";
}
}
The problem is that the cgi page just hangs while the remote script has completed execution and most or time takes about 600-650 seconds. This does not happen on all remote machines, only the ones that take quite a while for the remote script to complete.
Any ideas?