Will the LWP timeout trigger if some data has been sent, and data communication has been interrupted for x seconds?
I've been using the following code for getting hosted data from a timer controlled field station:
my $url = 'http://site.com/file.html';
my $content = get $url;
The problem is that sometimes it hangs on the get$url, and never comes back
It's an occasional glitch, but hangs my perl script entirely. I believe that the problem is that the webserver that I am collecting data from might be getting powered off before all of the data is sent back to my perl script, so my perl script is hanging for MORE data after getting the starting few bytes.
I have moved to LWP::agent using code ripped from:
$ident = "The Server"; # this gets logged
$timeout = 5; # in seconds
$ua = new LWP::UserAgent; # call the constructor
$ua->agent($ident); # set the id
$ua->timeout($timeout); # timeout
my $req = new HTTP::Request GET => 'http://site.com';
Will the timeout used here timeout even after getting some parts of the data, or will it only timeout if it doesn't get anything?