Skip to content

Commit

Permalink
Update Select.php
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor authored Dec 23, 2019
1 parent ddb2aef commit 5eb1b14
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Events/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,15 @@ public function loop()
$write = $this->_writeFds;
$except = $this->_exceptFds;

// Waiting read/write/signal/timeout events.
\set_error_handler(function(){});
$ret = \stream_select($read, $write, $except, 0, $this->_selectTimeout);
\restore_error_handler();
if ($read || $write || $except) {
// Waiting read/write/signal/timeout events.
set_error_handler(function(){});
$ret = stream_select($read, $write, $except, 0, $this->_selectTimeout);
restore_error_handler();
} else {
usleep($this->_selectTimeout);
$ret = false;
}


if (!$this->_scheduler->isEmpty()) {
Expand Down

0 comments on commit 5eb1b14

Please sign in to comment.