patch-SocketClosed #12
@@ -368,7 +368,7 @@ __END__
 | 
				
			|||||||
  ],
 | 
					  ],
 | 
				
			||||||
  "release_status": "stable",
 | 
					  "release_status": "stable",
 | 
				
			||||||
  "license": "GPL_2",
 | 
					  "license": "GPL_2",
 | 
				
			||||||
  "version": "v3.6.2",
 | 
					  "version": "v3.6.5",
 | 
				
			||||||
  "author": [
 | 
					  "author": [
 | 
				
			||||||
    "Marko Oldenburg <fhemdevelopment@cooltux.net>"
 | 
					    "Marko Oldenburg <fhemdevelopment@cooltux.net>"
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +1,2 @@
 | 
				
			|||||||
UPD 2022-03-13_11:13:55 18968 FHEM/82_LGTV_WebOS.pm
 | 
					UPD 2022-03-29_08:00:00 18968 FHEM/82_LGTV_WebOS.pm
 | 
				
			||||||
UPD 2022-03-13_11:13:52 54282 lib/FHEM/Devices/LGTV/LGTVWebOS.pm
 | 
					UPD 2022-03-31_06:22:06 55075 lib/FHEM/Devices/LGTV/LGTVWebOS.pm
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -704,7 +704,24 @@ sub Write {
 | 
				
			|||||||
      unless ( $hash->{CD} );
 | 
					      unless ( $hash->{CD} );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ::Log3( $name, 4, "LGTV_WebOS ($name) - $string" );
 | 
					    ::Log3( $name, 4, "LGTV_WebOS ($name) - $string" );
 | 
				
			||||||
    syswrite( $hash->{CD}, $string );
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					        syswrite( $hash->{CD}, $string );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    catch {
 | 
				
			||||||
 | 
					        if ( $_->isa('autodie::exception') && $_->matches(':io') ) {
 | 
				
			||||||
 | 
					            ::Log3( $name, 2,
 | 
				
			||||||
 | 
					"LGTV_WebOS ($name) - can't write to socket, autodie exception: $_"
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        else {
 | 
				
			||||||
 | 
					            ::Log3( $name, 2,
 | 
				
			||||||
 | 
					                "LGTV_WebOS ($name) - can't write to socket: $_" );
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -736,7 +753,23 @@ sub Read {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    $hash->{helper}->{lastResponse} =
 | 
					    $hash->{helper}->{lastResponse} =
 | 
				
			||||||
      int( ::gettimeofday() );    # Check Socket KeepAlive
 | 
					      int( ::gettimeofday() );    # Check Socket KeepAlive
 | 
				
			||||||
    $len = sysread( $hash->{CD}, $buf, 10240 );
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					        $len = sysread( $hash->{CD}, $buf, 10240 );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    catch {
 | 
				
			||||||
 | 
					        if ( $_->isa('autodie::exception') && $_->matches(':io') ) {
 | 
				
			||||||
 | 
					            ::Log3( $name, 2,
 | 
				
			||||||
 | 
					"LGTV_WebOS ($name) - can't read from socket, autodie exception: $_"
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        else {
 | 
				
			||||||
 | 
					            ::Log3( $name, 2,
 | 
				
			||||||
 | 
					                "LGTV_WebOS ($name) - can't read from socket: $_" );
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ( !defined($len) || !$len ) {
 | 
					    if ( !defined($len) || !$len ) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user