tp5.1自定义服务类swoole报错

浏览:1449 发布日期:2019/03/29 分类:求助交流
安装好 think-swoole 后 我在控制器中想添加一个自定义服务类报错,相求助下各位大神看看是什么原因<?php
namespace app\index\controller;

use think\swoole\Server;

class Login extends Server
{
    protected $host = '127.0.0.1';
    protected $port = 9501;
    protected $serverType = 'socket';
    protected $option = [
        'worker_num'=> 4,
        'daemonize'    => true,
        'backlog'    => 128
    ];

    public function onReceive($server, $fd, $from_id, $data)
    {
        $server->send($fd, 'Swoole: '.$data);
    }
}
报错

[2] ErrorException in Server.php line 80
Swoole\Server::__construct(): server is running. unable to create swoole_server.
提示我服务器正在运行无法创建swoole服务器,我该如何操作
最佳答案
评论( 相关
后面还有条评论,点击查看>>