/** * Connect to Kafka via a socket * * @return void * @throws Kafka_Exception */ public function connect() { if (null === $this->socket) { $this->socket = new Kafka_Socket($this->host, $this->port); } $this->socket->connect(); }
/** * Connect to Kafka via a socket * * @return void * @throws Kafka_Exception */ public function connect() { if (null === $this->socket) { $this->socket = new Kafka_Socket($this->host, $this->port, $this->recvTimeoutSec, $this->recvTimeoutUsec, $this->sendTimeoutSec, $this->sendTimeoutUsec); } $this->socket->connect(); }
/** * @expectedException Kafka_Exception_Socket_Connection */ public function testConnectInvalidHost() { $socket = new Kafka_Socket('invalid-host', 80); $socket->connect(); $this->fail('The above connect() call should fail on an invalid host'); }