protected function getConnectionForClientSocket($socket): ?Connection
    {
        if (!isset($this->connections[$this->resourceId($socket)])) {
            return null;
        }
        return $this->connections[$this->resourceId($socket)];
    }