about summary refs log tree commit
diff options
context:
space:
mode:
-rw-r--r--Changes2
-rw-r--r--lib/Net/Cmd.pm8
-rw-r--r--t/datasend.t2
3 files changed, 9 insertions, 3 deletions
diff --git a/Changes b/Changes
index 3992e00..5457727 100644
--- a/Changes
+++ b/Changes
@@ -2,7 +2,7 @@ Revision history for Perl distribution libnet
 
 3.09 Development
 
-    - TODO
+    - Provide (and document) a default Net::Cmd::timeout().  [CPAN RT#110978]
 
 3.08 2016-01-05
 
diff --git a/lib/Net/Cmd.pm b/lib/Net/Cmd.pm
index 1c312ca..3f102b9 100644
--- a/lib/Net/Cmd.pm
+++ b/lib/Net/Cmd.pm
@@ -190,6 +190,8 @@ sub set_status {
   1;
 }
 
+sub timeout { 0 }
+
 sub _syswrite_with_timeout {
   my $cmd = shift;
   my $line = shift;
@@ -748,6 +750,12 @@ command server.
 
 Returns undef upon failure.
 
+=item timeout ()
+
+Returns the timeout value for this class, in seconds. The timeout provided
+by the default implementation is 0; subclasses may override this if they
+choose.
+
 =item unsupported ()
 
 Sets the status code to 580 and the response text to 'Unsupported command'.
diff --git a/t/datasend.t b/t/datasend.t
index 0aea9d4..05903fb 100644
--- a/t/datasend.t
+++ b/t/datasend.t
@@ -21,8 +21,6 @@ BEGIN {
   use Net::Cmd;
   our @ISA = qw(Net::Cmd IO::File);
 
-  sub timeout { 0 }
-
   sub new {
     my $fh = shift->new_tmpfile;
     binmode($fh);