Skip Menu |

This queue is for tickets about the Net-Telnet CPAN distribution.

Report information
The Basics
Id: 111370
Status: new
Priority: 0/
Queue: Net-Telnet

Owner: Nobody in particular
Requestors: john_simpson [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: Timeout not honored under Windows 7 Enterprise
Date: Fri, 22 Jan 2016 11:10:14 -0500
To: bug-Net-Telnet [...]
From: John Simpson <john_simpson [...]>
Download (untitled) / with headers
text/plain 1.6k
I've posted this at to see if I can get a quick fix or workaround. The preliminary response by Corion is "On Windows, alarm() doesn't interrupt system calls, so that's maybe why the timeout isn't working properly." ----- I'm having difficulty controlling the timeout when initializing a Net::Telnet session. I set Timeout to 1, I've also set -timeout to 1. However, the the constructor is taking between 20 and 30 seconds before it times out and returns to the code. I need to bring this down to 2 seconds or less. Is there any way to make this call abort if it is not successfull within 1 or 2 seconds? Note that I am only having this problem in Windows. On the mac, the timeout works just fine. OS: Windows 7 Enterprise Version 6.1 (Build 7601: Service Pack 1) PERL: v5.16.3 built for MSWin32-x86-multi-thread This is ActivePerl 5.16.3 Build 1604 according to Windows. Here is the code to reproduce the problem: #!/usr/bin/perl # use strict; use warnings; use Net::Telnet; my $host = ''; # valid host that is offline my $port = 10001; print "DEBUG 1\n"; my $t = new Net::Telnet (Host => $host, Port => $port, Timeout => 1, # -timeout => 1, Prompt => '/Escape character is.+\n/', Rs => ' ', Ors => '', Binmode => 1, Telnetmode => 1, Errmode => 'return'); print "DEBUG 2\n"; if (!$t) { die "Failed to create telnet session\n"; }

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to