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

Report information
The Basics
Id:
111370
Status:
rejected
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
john_simpson [...] swajime.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



MIME-Version: 1.0
X-Spam-Status: No, score=-2.599 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
X-Spam-Flag: NO
Content-Type: multipart/alternative; boundary="001a11c0219e532e460529ee74ba"
Message-ID: <CAAPZw5zNoKSb_OjjOUBsn-V8jcpVaFPOh1D9SYq0b-DfdmzMfg@mail.gmail.com>
X-Received: by 10.37.3.129 with SMTP id 123mr1935545ybd.46.1453479014096; Fri, 22 Jan 2016 08:10:14 -0800 (PST)
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -2.599
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 7AB402403AF for <cpan-bug+Net-Telnet@hipster.bestpractical.com>; Fri, 22 Jan 2016 11:10:24 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ud+TgwtMYfWA for <cpan-bug+Net-Telnet@hipster.bestpractical.com>; Fri, 22 Jan 2016 11:10:23 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id C136C240328 for <bug-Net-Telnet@rt.cpan.org>; Fri, 22 Jan 2016 11:10:22 -0500 (EST)
Received: (qmail 3842 invoked by alias); 22 Jan 2016 16:10:21 -0000
Received: from mail-yk0-f179.google.com (HELO mail-yk0-f179.google.com) (209.85.160.179) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 22 Jan 2016 08:10:18 -0800
Received: by mail-yk0-f179.google.com with SMTP id a85so91429771ykb.1 for <bug-Net-Telnet@rt.cpan.org>; Fri, 22 Jan 2016 08:10:17 -0800 (PST)
Received: by 10.37.214.85 with HTTP; Fri, 22 Jan 2016 08:10:14 -0800 (PST)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i=@swajime-com.20150623.gappssmtp.com
Delivered-To: cpan-bug+Net-Telnet@hipster.bestpractical.com
Subject: Timeout not honored under Windows 7 Enterprise
Return-Path: <john_simpson@swajime.com>
X-RT-Mail-Extension: net-telnet
X-Original-To: cpan-bug+Net-Telnet@hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=swajime-com.20150623.gappssmtp.com; s=20150623; h=mime-version:date:message-id:subject:from:to:content-type; bh=4QVFnsFwQDp+/BomExZylmZRWs2yVVi6T59lf9rkKj8=; b=1b7trgtP56h/ZK4Iph+UR+iit6SnX1H8n0zG88HEyMUYJsTLf0YFa7XVKST4v3HMaQ 7DfQbXzGK8QoyrdLx4gWjE7kUm3DzJdFHUWpEyfoqQ+1ZifVwgyrjelT8eJWzxD5cRD7 8iXrS4iswrbfC5iHBlujOT/Tk03+K2Pr2lRZ4+LcckVGeFgN0Xa+ykMkY2YVijAQtiJ2 T8bVvSiRQLdJhd8Abt3vBjKLx30Pu9ka9uuIl9g1mBwOrjiC3HBeW3c0dUGgY3WN+4XD e356wjY2BJEIPkSxyqsZ9mZBKrmvqAy5LZGasOOga2Kj1DPyBG1THutDCrXWfarWxJfi iNtg==
X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=4QVFnsFwQDp+/BomExZylmZRWs2yVVi6T59lf9rkKj8=; b=HzQM2o85TgrS21Az1qn8RDLOkMxHszXyfQt4FipHkcOQEGa7WAFMdJxYYSKcmI1stC zK0zcEoiw3gWf4KMGuOglxfXKogvnWa1bNro5Q1QAsimjEa7fZffbvtM/3MYza1R24y7 gc7kRzHiG+ebMsXJHMMYe/Q/nfqI+00JU5JadT9vGxRZ3j3pcS7poNnxCUERyv+jM+2J 7Gslj6hpQV4GoUCEWKf1hNvJpPfTvJKRwv9yrNiCtIMXNfpzyMc25h/HpNVDjexs12HJ XtF18OoxCjSdL44FMyrWs2aMMkw9sql8uUzhT14SJGfT7RchpbTKiNyLOEWpEiONptsp trgg==
Date: Fri, 22 Jan 2016 11:10:14 -0500
X-Spam-Level:
To: bug-Net-Telnet@rt.cpan.org
From: John Simpson <john_simpson@swajime.com>
X-GM-Message-State: AG10YORYDeBj3IIK7uC1nlYvbWx3ku1EuUfDv8wi8BKBtiMeSjI76uWGv4KwgarocUVUJh59vLJP5G28iLTvNw==
X-RT-Interface: Email
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 1664
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 2670
I've posted this at http://perlmonks.org/?node_id=1153372 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 = '192.168.130.112'; # 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"; }
MIME-Version: 1.0
In-Reply-To: <CAAPZw5zNoKSb_OjjOUBsn-V8jcpVaFPOh1D9SYq0b-DfdmzMfg@mail.gmail.com>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <CAAPZw5zNoKSb_OjjOUBsn-V8jcpVaFPOh1D9SYq0b-DfdmzMfg@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-15084-1582064390-1471.111370-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 2089
Jim, Sorry I don't have much time for individual help. Yes connection timeout doesn't work for MS-Windows. There is no facility for it. This is documented in the Net::Telnet section "What To Know Before Using". I hope you found a solution to your problem. On Fri Jan 22 11:10:25 2016, john_simpson@swajime.com wrote:
Show quoted text
> I've posted this at http://perlmonks.org/?node_id=1153372 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 = '192.168.130.112'; # 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 runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.