in consumer/fsof/FSOFProcessor.php [169:204]
protected function connectProvider($host, $port, $iotimeout)
{
try
{
$start_time = microtime(true);//取到微秒
$client = new FSOFClient4Linux();
if ($client->connect($host,$port,$iotimeout))
{
$this->logger->debug('connect to server['.$host.":".$port."] success,timeout:".$iotimeout);
}
else
{
//记录错误码
$this->lastErrorNo = $client->getlasterror();
$cost_time = (int)((microtime(true) - $start_time) * 1000000);
$this->logger->error('connect to server['.$host.":".$port."] failed,timeout:".$iotimeout."|".$cost_time."us".'|errcode:'.$this->lastErrorNo);
unset($client);
}
}
catch (\Exception $e)
{
unset($client);
$this->logger->error("Connect provider exception:",$e);
}
if (isset($client))
{
return $client;
}
else
{
return NULL;
}
}