src/mako/redis/Connection.php
protected function createConnection(string $host, int $port, bool $persistent, int $timeout)
	{
		try
		{
			if($persistent)
			{
				return pfsockopen('tcp://' . $host, $port, $errNo, $errStr, $timeout);
			}

			return fsockopen('tcp://' . $host, $port, $errNo, $errStr, $timeout);
		}
		catch(Throwable $e)
		{
			$message = $this->name === null ? 'Failed to connect' : vsprintf('Failed to connect to [ %s ]', [$this->name]);

			throw new RedisException(vsprintf('%s. %s', [$message, $e->getMessage()]), (int) $errNo);
		}
	}
protected function createConnection(string $host, int $port, bool $persistent, int $timeout)
	{
		try
		{
			if($persistent)
			{
				return pfsockopen('tcp://' . $host, $port, $errNo, $errStr, $timeout);
			}

			return fsockopen('tcp://' . $host, $port, $errNo, $errStr, $timeout);
		}
		catch(Throwable $e)
		{
			$message = $this->name === null ? 'Failed to connect' : vsprintf('Failed to connect to [ %s ]', [$this->name]);

			throw new RedisException(vsprintf('%s. %s', [$message, $e->getMessage()]), (int) $errNo);
		}
	}
protected function createConnection ( string $ host , int $ port , bool $ persistent , int $ timeout ) { try { if ( $ persistent ) { return pfsockopen ( 'tcp://' . $ host , $ port , $ errNo , $ errStr , $ timeout ) ; } return fsockopen ( 'tcp://' . $ host , $ port , $ errNo , $ errStr , $ timeout ) ; } catch ( Throwable $ e ) { $ message = $ this -> name === null ? 'Failed to connect' : vsprintf ( 'Failed to connect to [ %s ]' , [ $ this -> name ] ) ; throw new RedisException ( vsprintf ( '%s. %s' , [ $ message , $ e -> getMessage ( ) ] ) , ( int ) $ errNo ) ; } }
Creates a socket connection to the server.

@param  string                     $host       Redis host
@param  int                        $port       Redis port
@param  bool                       $persistent Should the connection be persistent?
@param  int                        $timeout    Timeout in seconds
@throws \mako\redis\RedisException
@return resource
Creates a socket connection to the server .