I'm seeking clarification on how the timeout works in reads within
Net::Telnet. Consider this code snippet.
##
## Use getline to get switch response. Times out on last line;
no newline
##
$t->print("show output");
while ($result = $t->getline(Errmode => "return"))
{
print DMPFILE "$result";
}
$result = $t->errmsg;
if ($result eq "read timed-out")
{
$result = $t->get(Timeout => 3); ## Get end of
read block without newline
print DMPFILE "$result\n";
}
else
{
print DMPFILE "Getline error message = $result\n";
exit(102);
}
If I have the default 10 second timeout, does it apply to each getline()
or does it apply to the time required for the total response to the
"show output" command. When the application is created it will be
interfacing with a telecommunications switch and will be requesting
data. Due to the size of the data and slow communications link it will
take a long time for the command to complete. I want to design the most
effective means to recognize true timeouts, but I need to allow for the
inherent slowness of communicating with the switch.
Any experience in this area is welcome.
Steve
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs