Exemplo n.º 1
0
 /**
  * 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();
 }
Exemplo n.º 2
0
 /**
  * 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();
 }
Exemplo n.º 3
0
 /**
  * @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');
 }