From d9c6a10dc21c1fff4cc1aea1039383f33c3279ce Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Thu, 31 Mar 2022 14:56:38 +0200 Subject: [PATCH] Close Socket then catch excepstion --- controls_LGTV_WebOS.txt | 4 ++-- lib/FHEM/Devices/LGTV/LGTVWebOS.pm | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/controls_LGTV_WebOS.txt b/controls_LGTV_WebOS.txt index 50742c5..69ab362 100644 --- a/controls_LGTV_WebOS.txt +++ b/controls_LGTV_WebOS.txt @@ -1,2 +1,2 @@ -UPD 2022-03-29_08:00:00 18968 FHEM/82_LGTV_WebOS.pm -UPD 2022-03-31_06:22:06 55075 lib/FHEM/Devices/LGTV/LGTVWebOS.pm +UPD 2022-03-31_06:48:33 18968 FHEM/82_LGTV_WebOS.pm +UPD 2022-03-31_14:55:57 55129 lib/FHEM/Devices/LGTV/LGTVWebOS.pm diff --git a/lib/FHEM/Devices/LGTV/LGTVWebOS.pm b/lib/FHEM/Devices/LGTV/LGTVWebOS.pm index b8d5308..92c3184 100644 --- a/lib/FHEM/Devices/LGTV/LGTVWebOS.pm +++ b/lib/FHEM/Devices/LGTV/LGTVWebOS.pm @@ -710,9 +710,11 @@ sub Write { } catch { if ( $_->isa('autodie::exception') && $_->matches(':io') ) { - ::Log3( $name, 2, + ::Log3( $name, 4, "LGTV_WebOS ($name) - can't write to socket, autodie exception: $_" ); + + Close($hash); return; } else { @@ -759,9 +761,11 @@ sub Read { } catch { if ( $_->isa('autodie::exception') && $_->matches(':io') ) { - ::Log3( $name, 2, + ::Log3( $name, 4, "LGTV_WebOS ($name) - can't read from socket, autodie exception: $_" ); + + Close($hash); return; } else { -- 2.45.2