public function run_pre()
{
set_error_handler(array($this, 'error_handler'));
$serv = new swoole_http_server($this->host, $this->port);
$serv->set($this->setargv);
$serv->on('Start', array($this, 'onStart'));
$serv->on('ManagerStart', array($this, 'onManagerStart'));
$serv->on('WorkerStart', array($this, 'onWorkerStart'));
$serv->on('WorkerError', array($this, 'onWorkerError'));
$serv->on('Request', array($this, 'onRequest'));
return $serv;
}
function run()
{
$serv = $this->run_pre();
$serv->start();
}
public function onStart($serv)
{
//代码执行
}
里面的$serv->on('Start', array($this, 'onStart'));怎么调用public function onStart($serv)
江户川乱折腾
守着星空守着你
繁花不似锦
德玛西亚99