diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-06-29 04:35:56 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-06-29 04:44:10 -0500 |
commit | c3712cb3c02bc081941c9525b0f9ec96c53d9a65 (patch) | |
tree | 587613ba83766790fda35d48a073b0fcb62a11fc /lib | |
parent | 35d3a027750a39759a71a75df6a9591d0f2bfab8 (diff) | |
download | io-socket-telnet-halfduplex-c3712cb3c02bc081941c9525b0f9ec96c53d9a65.tar.gz io-socket-telnet-halfduplex-c3712cb3c02bc081941c9525b0f9ec96c53d9a65.zip |
rename constructor parameter to "ping_option"
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IO/Socket/Telnet/HalfDuplex.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/IO/Socket/Telnet/HalfDuplex.pm b/lib/IO/Socket/Telnet/HalfDuplex.pm index 61ae4a6..f4fbe0c 100644 --- a/lib/IO/Socket/Telnet/HalfDuplex.pm +++ b/lib/IO/Socket/Telnet/HalfDuplex.pm @@ -4,9 +4,9 @@ use base 'IO::Socket::Telnet'; sub new { my $class = shift; my %args = @_; - my $code = delete $args{code} || 99; + my $ping = delete $args{ping_option} || 99; my $self = $class->SUPER::new(@_); - ${*{$self}}{code} = $code; + ${*{$self}}{ping_option} = $ping; $self->IO::Socket::Telnet::telnet_simple_callback(\&telnet_negotiation); return $self; } @@ -21,7 +21,7 @@ sub read { my $self = shift; my $buffer; - $self->do(chr(${*{$self}}{code})); + $self->do(chr(${*{$self}}{ping_option})); ${*{$self}}{got_pong} = 0; eval { @@ -48,8 +48,8 @@ sub telnet_negotiation { my $option = shift; my $external_callback = ${*{$self}}{halfduplex_simple_cb}; - my $code = ${*{$self}}{code}; - if ($option =~ / $code$/) { + my $ping = ${*{$self}}{ping_option}; + if ($option =~ / $ping$/) { ${*{$self}}{got_pong} = 1; return '' unless $external_callback; return $self->$external_callback($option); |