Skip to content

Commit

Permalink
Merge 1f13be0 into 107e093
Browse files Browse the repository at this point in the history
  • Loading branch information
duckboy81 committed Oct 23, 2020
2 parents 107e093 + 1f13be0 commit ca21ddb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Context/Internal/ProcessHub.php
Expand Up @@ -74,8 +74,11 @@ public function __construct()
$this->watcher = Loop::onReadable(
$this->server,
static function (string $watcher, $server) use (&$keys, &$acceptor): void {
// Error reporting suppressed since stream_socket_accept() emits E_WARNING on client accept failure.
while ($client = @\stream_socket_accept($server, 0)) { // Timeout of 0 to be non-blocking.
$read = [$server];
$empty = [];
// To prevent debuggers from triggering when stream_socket_accept() emits E_WARNING on client accept failure,
// first check to see if there is a stream waiting for us.
while (stream_select($read, $empty, $empty, 0) && $client = \stream_socket_accept($server, 0)) { // Timeout of 0 to be non-blocking.
asyncCall(static function () use ($client, &$keys, &$acceptor) {
$channel = new ChannelledSocket($client, $client);

Expand Down

0 comments on commit ca21ddb

Please sign in to comment.