From 0a2182e92bd6843f32a310630c4205073e0c2e3e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 2 Nov 2010 23:48:57 -0500 Subject: if recv returns '', that means we're disconnected without an error --- lib/App/Termcast.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index 132a2b7..bf719e5 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -295,8 +295,13 @@ sub run { $self->_got_winch(0); redo; } - Carp::croak("Error reading from socket: $!") - unless defined $buf; + + if (defined $buf) { + $self->clear_socket; + } + else { + Carp::croak("Error reading from socket: $!"); + } } if ($self->bell_on_watcher) { -- cgit v1.2.3-54-g00ecf