ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
Net::Telnet Timeout
by Steve Smith other posts by this author
Aug 2 2007 2:24PM messages near this date
compilation | ActiveState releases ActivePerl 5.8.8.822
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved