diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-11-02 23:47:51 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-11-02 23:47:51 -0500 |
commit | 706298e73d7ce7b264b50c7a5535bc0581243632 (patch) | |
tree | 9bc842ca4374eb56ff139edd5a338f755c992d84 | |
parent | 508218365c734253b7a0855084031be28446de66 (diff) | |
download | app-termcast-706298e73d7ce7b264b50c7a5535bc0581243632.tar.gz app-termcast-706298e73d7ce7b264b50c7a5535bc0581243632.zip |
always warn when reconnecting
-rw-r--r-- | lib/App/Termcast.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index dc9a6c0..df5870c 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -146,6 +146,10 @@ sub _build_socket { return $socket; } +before clear_socket => sub { + Carp::carp("Lost connection to server ($!), reconnecting..."); +}; + has pty => ( traits => ['NoGetopt'], is => 'rw', @@ -214,7 +218,6 @@ sub write_to_termcast { my ($rout, $wout, $eout); my $ready = select(undef, $wout = $win, $eout = $ein, $self->timeout); if (!$ready || $self->_socket_ready($eout)) { - Carp::carp("Lost connection to server ($!), reconnecting..."); $self->clear_socket; return $self->write_to_termcast(@_); } @@ -245,7 +248,6 @@ sub run { select($rout = $rin, undef, $eout = $ein, undef); if ($self->_socket_ready($eout)) { - Carp::carp("Lost connection to server ($!), reconnecting..."); $self->clear_socket; } |