主服务器

    1. 'server' => [
    2. 'server_type' => \One\Swoole\OneServer::SWOOLE_SERVER, // 主服务器类型
    3. 'port' => 9086,
    4. 'action' => \App\GlobalData\Server::class, // 主服务器事件回调类
    5. 'mode' => SWOOLE_BASE,
    6. 'sock_type' => SWOOLE_SOCK_TCP,
    7. 'ip' => '127.0.0.1',
    8. 'pack_protocol' => \One\Protocol\Frame::class, // tcp 打包 解包协议
    9. 'set' => [ // set 相关配置
    10. 'worker_num' => 1,
    11. 'reactor_num' => 1,
    12. 'open_length_check' => 1,
    13. 'package_length_func' => '\One\Protocol\Frame::length',
    14. 'package_body_offset' => \One\Protocol\Frame::HEAD_LEN,
    15. ]
    16. ]

    添加tcp监听

    1. [
    2. 'port' => 8083,
    3. 'pack_protocol' => \One\Protocol\Text::class,
    4. 'action' => \App\Test\MixPro\TcpPort::class,
    5. 'type' => SWOOLE_SOCK_TCP,
    6. 'ip' => '0.0.0.0',
    7. 'set' => [
    8. 'open_http_protocol' => false,
    9. 'open_websocket_protocol' => false
    10. ]
    11. ],