Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DumpServer.php

function DumpServer::getMessages

1 call to DumpServer::getMessages()
DumpServer::listen in vendor/symfony/var-dumper/Server/DumpServer.php

File

vendor/symfony/var-dumper/Server/DumpServer.php, line 87

Class

DumpServer
A server collecting Data clones sent by a ServerDumper.

Namespace

Symfony\Component\VarDumper\Server

Code

private function getMessages() : iterable {
    $sockets = [
        (int) $this->socket => $this->socket,
    ];
    $write = [];
    while (true) {
        $read = $sockets;
        stream_select($read, $write, $write, null);
        foreach ($read as $stream) {
            if ($this->socket === $stream) {
                $stream = stream_socket_accept($this->socket);
                $sockets[(int) $stream] = $stream;
            }
            elseif (feof($stream)) {
                unset($sockets[(int) $stream]);
                fclose($stream);
            }
            else {
                (yield (int) $stream => fgets($stream));
            }
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal