protected function createServerSocket(array $config)
    {
        $protocol = $config['protocol'] ?? 'tcp';

        if (isset($this->serverSocketExtensions[$protocol])) {
            $serverSocket = call_user_func($this->serverSocketExtensions[$protocol], $this->app, $config);

            if (! $serverSocket instanceof ServerSocketContract) {
                throw new InvalidArgumentException(
                    "The protocol [{$protocol}] resolver must return a ServerSocket instance."
                );
            }

            return $serverSocket;
        }

        if (method_exists($this, $method = 'create'.Str::studly($protocol).'ServerSocket')) {
            return $this->$method($config);
        }

        throw new InvalidArgumentException("The protocol [{$protocol}] is not supported.");
    }