public function connect()

in src/Apache/Ignite/Internal/Connection/ClientSocket.php [83:108]


    public function connect(): void
    {
        $tlsOptions = $this->config->getTLSOptions();
        $options = ['socket' => ['tcp_nodelay' => $this->config->getTcpNoDelay()]];
        if ($tlsOptions) {
            $options['ssl'] = $tlsOptions;
        }
        $context = stream_context_create($options);
        $errno = 0;
        $errstr = null;
        if (!($this->socket = stream_socket_client(
                ($tlsOptions ? 'ssl://' : 'tcp://') . $this->endpoint,
                $errno,
                $errstr,
                ini_get('default_socket_timeout'),
                STREAM_CLIENT_CONNECT,
                $context))) {
            throw new NoConnectionException($errstr);
        }
        if ($this->config->getTimeout() > 0) {
            $timeout = $this->config->getTimeout();
            stream_set_timeout($this->socket, intdiv($timeout, 1000), $timeout % 1000);
        }
        // send handshake
        $this->processRequest($this->getHandshakeRequest(ClientSocket::$currentVersion));
    }