16_STACKABLE.pm: add some timeout to the blocking get

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@14018 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-04-17 16:33:06 +00:00
parent 8e9772e550
commit e71c679896

View File

@ -130,7 +130,9 @@ STACKABLE_IOReadFn($) # used by synchronuous get
$me->{IODev}{PARTIAL} = "";
}
while($buf !~ m/\n/) {
$buf .= DevIo_SimpleRead($me->{IODev}); # may block
my $ret = DevIo_SimpleReadWithTimeout($me->{IODev}, 1); # may block
return undef if(!defined($ret));
$buf .= $ret;
}
my $mName = $me->{NAME};