From 706298e73d7ce7b264b50c7a5535bc0581243632 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 2 Nov 2010 23:47:51 -0500 Subject: always warn when reconnecting --- lib/App/Termcast.pm | 6 ++++-- 1 file 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; } -- cgit v1.2.3-54-g00ecf