求大佬帮帮忙 这是什么问题。回调该怎么写

浏览:186 发布日期:2021/11/29 分类:ThinkPHP5专区 关键字: swoole,ThinkPHP
启动服务报错
推送模块启动中...
[think\exception\ErrorException]
Swoole\Server::on(): unknown event types[Open]


$this->event=array(21) {
[0] => string(5) "Start"
[1] => string(8) "Shutdown"
[2] => string(11) "WorkerStart"
[3] => string(10) "WorkerStop"
[4] => string(10) "WorkerExit"
[5] => string(7) "Connect"
[6] => string(7) "Receive"
[7] => string(6) "Packet"
[8] => string(5) "Close"
[9] => string(10) "BufferFull"
[10] => string(11) "BufferEmpty"
[11] => string(4) "Task"
[12] => string(6) "Finish"
[13] => string(11) "PipeMessage"
[14] => string(11) "WorkerError"
[15] => string(12) "ManagerStart"
[16] => string(11) "ManagerStop"
[17] => string(4) "Open"
[18] => string(7) "Message"
[19] => string(9) "HandShake"
[20] => string(7) "Request"
}

// 设置回调
foreach ($this->event as $event) {
if (method_exists($this, 'on' . $event)) {
$this->swoole->on($event, [$this, 'on' . $event]);
}
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>