execute($server, $fd); fire(Event::SYSTEM_RESOURCE_RELEASES); } /** * @param Server $server * @param int $fd * @throws ComponentException * @throws Exception */ private function execute(Server $server, int $fd): void { try { if (!$server instanceof WServer) { return; } if (!$server->isEstablished($fd)) { return; } $this->loadNode($server, $fd); } catch (\Throwable $exception) { $this->addError($exception); } finally { $logger = Snowflake::app()->getLogger(); $logger->insert(); } } /** * @param $server * @param $fd * @return mixed * @throws ComponentException * @throws ConfigException * @throws NotFindClassException * @throws Exception */ private function loadNode($server, $fd): mixed { $query = Request::socketQuery((object)['fd' => $fd], Socket::CLOSE); if (($node = router()->find_path($query)) !== null) { return $node->dispatch($server, $fd); } return null; } }