Example #1
0
 private function connect()
 {
     try {
         $config = Zend_Registry::get('configuration');
         $options = array('host' => $config->name2id->host, 'port' => $config->name2id->port);
         $socket = new TZSocket($options['host'], $options['port']);
         $socket->setSendTimeout(1000);
         $socket->setRecvTimeout(1000);
         $this->transport = new TFramedTransport($socket);
         $protocol = new TBinaryProtocolAccelerated($this->transport);
         $this->client = new TName2IDServiceClient($protocol);
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #2
0
 private function connect()
 {
     try {
         $config = Zend_Registry::get('appconf');
         $options = array('host' => $config->hugelist->read->host, 'port' => $config->hugelist->read->port);
         $this->APPLICATION_ID = 1002;
         $socket = new TZSocket($options['host'], $options['port']);
         $socket->setSendTimeout(1000);
         $socket->setRecvTimeout(1000);
         $this->transport = new TFramedTransport($socket);
         $protocol = new TBinaryProtocolAccelerated($this->transport);
         $this->client = new THugeListInt_DataServiceRClient($protocol);
     } catch (Exception $e) {
         throw $e;
     }
 }