/** * @param string $url * @param int $port * @param string $authKey * @param boolean $debug */ public function __construct($url, $port, $authKey = null, $debug = false) { if ($debug) { $this->debug = true; } $this->authKey = $authKey; $this->driver = new Driver(); $this->stream = new Stream($url, Connection::PROTOCOL_TCP, $port, $this->driver); $this->stream->open(); $this->stream->setBlockingOff(); $this->stream->setReadTimeOut(0, (double) 500000); $this->stream->setReceiveMethod(new StreamGetLineMethod(1024, Driver::EOL)); $this->authenticateWithConstructor(); }