src/Server/BasicServer.php
private function createPoll($resource, \SplQueue $queue): Io
    {
        return Loop\poll($resource, static function ($resource, bool $expired, Io $poll) use ($queue) {
            // Error reporting suppressed since stream_socket_accept() emits E_WARNING on client accept failure.
            $socket = @stream_socket_accept($resource, 0); // Timeout of 0 to be non-blocking.

            // Having difficulty finding a test to cover this scenario, but it has been seen in production.
            if (!$socket) {
                $poll->listen(); // Accept failed, let's go around again.
                return;
            }

            /** @var \Icicle\Awaitable\Delayed $delayed */
            $delayed = $queue->shift();
            $delayed->resolve($socket);
        });
    }
private function createPoll($resource, \SplQueue $queue): Io
    {
        return Loop\poll($resource, static function ($resource, bool $expired, Io $poll) use ($queue) {
            // Error reporting suppressed since stream_socket_accept() emits E_WARNING on client accept failure.
            $socket = @stream_socket_accept($resource, 0); // Timeout of 0 to be non-blocking.

            // Having difficulty finding a test to cover this scenario, but it has been seen in production.
            if (!$socket) {
                $poll->listen(); // Accept failed, let's go around again.
                return;
            }

            /** @var \Icicle\Awaitable\Delayed $delayed */
            $delayed = $queue->shift();
            $delayed->resolve($socket);
        });
    }
@param resource $resource
@param \SplQueue $queue

@return \Icicle\Loop\Watcher\Io