diff --git a/src/StreamSelectLoop.php b/src/StreamSelectLoop.php index 7d455048..395f7f8b 100644 --- a/src/StreamSelectLoop.php +++ b/src/StreamSelectLoop.php @@ -218,7 +218,12 @@ private function waitForStreamActivity($timeout) $read = $this->readStreams; $write = $this->writeStreams; - $this->streamSelect($read, $write, $timeout); + $available = $this->streamSelect($read, $write, $timeout); + if (false === $available) { + // if a system call has been interrupted, + // we cannot rely on it's outcome + return; + } foreach ($read as $stream) { $key = (int) $stream;