Active connections */ private SplObjectStorage $connections; public function __construct() { $this->connections = new SplObjectStorage(); } public function __invoke(ServerRequestInterface $request, ?callable $next=null) { } private function parseSettingsFromBase64String(string $settings): SettingsFrame { $decoded = base64_decode($settings); $frame = new SettingsFrame(); $frame->parseFrame($decoded); return $frame; } private function setupConnection(ServerRequestInterface $request): Http2Connection { $stream = new ThroughStream(); $connection = new Http2Connection($stream); $this->connections->attach($connection); $connection->on('close', function () use ($connection) { $this->connections->detach($connection); }); return $connection; } }