diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-06-30 00:07:24 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-06-30 00:07:24 -0500 |
commit | 3aa003a1fcb299c9e116ec401cfed039fd4a9005 (patch) | |
tree | bbec52865f8934da5db9b0f2f19229e82d63ac57 /lib | |
parent | 077479b0030445f541470804f8f7e57a2ad68f72 (diff) | |
download | io-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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IO/Socket/Telnet/HalfDuplex.pm | 5 |
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); |