buxgfix: prevent fhem from stalling if telnet times out in 66_ECMD.pm
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1070 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -149,7 +149,16 @@ ECMD_OpenDev($$)
|
||||
return;
|
||||
}
|
||||
|
||||
my $conn = IO::Socket::INET->new(PeerAddr => $devicename);
|
||||
my $conn;
|
||||
eval {
|
||||
local $SIG{ALRM} = sub { die 'Timed Out'; };
|
||||
alarm 10;
|
||||
$conn = IO::Socket::INET->new(PeerAddr => $devicename, timeout => 5);
|
||||
};
|
||||
alarm 0;
|
||||
$conn= undef if $@;
|
||||
# return "Error: timeout." if ( $@ && $@ =~ /Timed Out/ );
|
||||
# return "Error: Eval corrupted: $@" if $@;
|
||||
if($conn) {
|
||||
delete($hash->{NEXT_OPEN})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user