Pheanstalk\Socket\NativeSocket::__construct PHP Method

__construct() public method

public __construct ( string $host, integer $port, integer $connectTimeout, boolean $connectPersistent )
$host string
$port integer
$connectTimeout integer
$connectPersistent boolean
    public function __construct($host, $port, $connectTimeout, $connectPersistent)
    {
        if ($connectPersistent) {
            $this->_socket = $this->_wrapper()->pfsockopen($host, $port, $errno, $errstr, $connectTimeout);
        } else {
            $this->_socket = $this->_wrapper()->fsockopen($host, $port, $errno, $errstr, $connectTimeout);
        }
        if (!$this->_socket) {
            throw new Exception\ConnectionException($errno, $errstr . " (connecting to {$host}:{$port})");
        }
        $this->_wrapper()->stream_set_timeout($this->_socket, self::SOCKET_TIMEOUT);
    }