diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-11-02 23:48:57 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-11-02 23:48:57 -0500 |
commit | 0a2182e92bd6843f32a310630c4205073e0c2e3e (patch) | |
tree | 36ea5616ae75b54d36dacddd074b2c900eef2b8a | |
parent | 0df616f5517aae63bcd01b3147ec45b7943ddefb (diff) | |
download | app-termcast-0a2182e92bd6843f32a310630c4205073e0c2e3e.tar.gz app-termcast-0a2182e92bd6843f32a310630c4205073e0c2e3e.zip |
if recv returns '', that means we're disconnected without an error
-rw-r--r-- | lib/App/Termcast.pm | 9 |
1 files 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) { |