summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-06-30 00:07:24 -0500
committerJesse Luehrs <doy@tozt.net>2009-06-30 00:07:24 -0500
commit3aa003a1fcb299c9e116ec401cfed039fd4a9005 (patch)
treebbec52865f8934da5db9b0f2f19229e82d63ac57
parent077479b0030445f541470804f8f7e57a2ad68f72 (diff)
downloadio-socket-telnet-halfduplex-3aa003a1fcb299c9e116ec401cfed039fd4a9005.tar.gz
io-socket-telnet-halfduplex-3aa003a1fcb299c9e116ec401cfed039fd4a9005.zip
actually, the ping has to be 40-2390.01
codes 0-39 are taken by options, and codes 240-255 are taken by the actual protocol
-rw-r--r--lib/IO/Socket/Telnet/HalfDuplex.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/IO/Socket/Telnet/HalfDuplex.pm b/lib/IO/Socket/Telnet/HalfDuplex.pm
index 4cd7c0c..7e108a5 100644
--- a/lib/IO/Socket/Telnet/HalfDuplex.pm
+++ b/lib/IO/Socket/Telnet/HalfDuplex.pm
@@ -55,8 +55,8 @@ L<IO::Socket::Telnet>.
=head2 new(PARAMHASH)
The constructor takes mostly the same arguments as L<IO::Socket::INET>, but
-also accepts the key C<PingOption>, which takes an integer from 0-255 to use
-for the ping/pong mechanism. This defaults to 99 if not specified.
+also accepts the key C<PingOption>, which takes an integer between 40 and 239
+to use for the ping/pong mechanism. This defaults to 99 if not specified.
=cut
@@ -64,6 +64,7 @@ sub new {
my $class = shift;
my %args = @_;
my $ping = delete $args{PingOption} || 99;
+ die "Invalid option: $ping (must be 40-239)" if $ping < 40 || $ping >= 240;
my $self = $class->SUPER::new(@_);
${*{$self}}{ping_option} = $ping;
$self->IO::Socket::Telnet::telnet_simple_callback(\&_telnet_negotiation);