src/Stream/DefaultStream.php
public function connect()
    {
        $connectTimeout = 1;
        $errstr = '';
        $errno = 0;
        $stream = @stream_socket_client($this->nodeUrl, $errno, $errstr, $connectTimeout);

        if (!$stream) {
            $this->log->warning('unable to connect to '.$this->nodeUrl.': '.$errstr);
            throw new ConnectException('Unable to connect to resource '.$this->nodeUrl.'. '.$errstr, $errno);
        }

        $this->log->info('connected to '.$this->nodeUrl);
        $this->stream = $stream;

        return true;
    }
public function connect()
    {
        $connectTimeout = 1;
        $errstr = '';
        $errno = 0;
        $stream = @stream_socket_client($this->nodeUrl, $errno, $errstr, $connectTimeout);

        if (!$stream) {
            $this->log->warning('unable to connect to '.$this->nodeUrl.': '.$errstr);
            throw new ConnectException('Unable to connect to resource '.$this->nodeUrl.'. '.$errstr, $errno);
        }

        $this->log->info('connected to '.$this->nodeUrl);
        $this->stream = $stream;

        return true;
    }
public function connect ( ) { $ connectTimeout = 1 ; $ errstr = '' ; $ errno = 0 ; $ stream = @ stream_socket_client ( $ this -> nodeUrl , $ errno , $ errstr , $ connectTimeout ) ; if ( ! $ stream ) { $ this -> log -> warning ( 'unable to connect to ' . $ this -> nodeUrl . ': ' . $ errstr ) ; throw new ConnectException ( 'Unable to connect to resource ' . $ this -> nodeUrl . '. ' . $ errstr , $ errno ) ; } $ this -> log -> info ( 'connected to ' . $ this -> nodeUrl ) ; $ this -> stream = $ stream ; return true ; }
Connect the stream.

@return boolean True if connection could be established.

@throws ConnectException
Connect the stream .