Пример #1
0
 /**
  * 初始化服务器列表与控制参数
  * 服务器列表格式为:array('192.168.0.1:8080', '192.168.0.2:8080', ...)
  * 控制参数格式为:array('connection_timeout' => 1, 'readwrite_timeout' => 2, 'key' => 'xxxxxxx')
  * 
  * @param array $servers 服务器列表
  * @param array $params 参数列表
  */
 public function __construct($servers, $params = array())
 {
     parent::__construct($servers, $params);
     if (isset($params['key'])) {
         $this->key = $params['key'];
     }
 }
 /**
  * Overridden to provide jsonrpc error handling.
  * @param object $serviceObject
  * @param string $method
  * @param array $params
  * @return mixed
  */
 function callServiceMethod($serviceObject, $method, $params)
 {
     $result = parent::callServiceMethod($serviceObject, $method, $params);
     /*
      * See if the result of the function was actually an error, and if
      * yes, add the script transport id.
      */
     if (is_a($result, "JsonRpcError")) {
         $result->setScriptTransportId($this->getErrorBehavior()->getScriptTransportId());
     }
     return $result;
 }
Пример #3
0
 public function __construct($port, $timeout, $max_connection)
 {
     parent::__construct($port, $timeout, $max_connection);
 }