public function close(Server $server, int $fd)
    {
        try {
            if (!$path = WebSocketContext::getMeta('path', $fd)) {
                throw new ContextLostException(
                    "The connection info has lost of the fd#$fd, on connection closed"
                );
            }

            $className = $this->getHandler($path)[0];

            /** @var HandlerInterface $handler */
            $handler = \bean($className);

            if (\method_exists($handler, 'onClose')) {
                $handler->onClose($server, $fd);
            }
        } catch (\Throwable $e) {
            App::error($e->getMessage(), ['fd' => $fd]);
        }
    }