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);
}