国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

window版本onMessage is not callable

surechina

項(xiàng)目寫在Linux版本下,按照教程轉(zhuǎn)到window下運(yùn)行、gatewayWorker,發(fā)下onMessage接受不了信息,用webSocket能夠連上,也能接受gateway的心跳信息,就是gateway端不能接受web的信息,

php start_register.php start_gateway.php start_businessworker.php start_tcp.php 啟動(dòng)后提示

----------------------- WORKERMAN -----------------------------
Workerman version:3.2.5          PHP version:5.4.16
------------------------ WORKERS -------------------------------
worker                 listen                    processes status
Register               text://0.0.0.0:1238        1        
WebsocketGateway       Websocket://0.0.0.0:1129   1        
YourAppBusinessWorker  none                       1        
TcpGateway             tcp://0.0.0.0:8282         1        
----------------------------------------------------------------
Press Ctrl-C to quit. Start success.
Waring: Event::onMessage is not callable
9713 3 1
3個(gè)回答

walkor 打賞

這個(gè)是因?yàn)閣orkerman版本和GatewayWorker版本不一致導(dǎo)致的。
把GatewayWorker和Workerman(win)都更新到最新就好了

  • 暫無評(píng)論
wodetian55

很遺憾的告訴樓主,其實(shí)作者的回復(fù)是錯(cuò)的。。。。
正確的修改方式:
找到y(tǒng)ourProj下的start_businessworker.php
然后

<?php 
/**
 * This file is part of workerman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link http://wtbis.cn/
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
 */
use \Workerman\Worker;
use \Workerman\WebServer;
use \GatewayWorker\Gateway;
use \GatewayWorker\BusinessWorker;
use \Workerman\Autoloader;

// 自動(dòng)加載類
require_once __DIR__ . '/../../Workerman/Autoloader.php';
Autoloader::setRootPath(__DIR__);

// bussinessWorker 進(jìn)程
$worker = new BusinessWorker();
// worker名稱
$worker->name = 'DemoBusinessWorker';
// bussinessWorker進(jìn)程數(shù)量
$worker->count = 4;
// 服務(wù)注冊(cè)地址
$worker->registerAddress = '127.0.0.1:2688';
// 需要將eventHandler的默認(rèn)值Events修改成Event就可以了
$worker->eventHandler = 'Event';

// 如果不是在根目錄啟動(dòng),則運(yùn)行runAll方法
if(!defined('GLOBAL_START'))
{
    Worker::runAll();
}
  • walkor 2019-06-09

    設(shè)置$worker->eventHandler = 'Event'; 是錯(cuò)誤做法,因?yàn)闀?huì)和Event擴(kuò)展沖突,會(huì)導(dǎo)致Events::onMessage is not callable。

zasray

哈哈 我是來看二樓的

  • walkor 2019-06-09

    題主的問題是由于題主的linux環(huán)境和windows環(huán)境版本不一致導(dǎo)致。這個(gè)問題恰逢gatewayWorker的2.0.4版本中將Event.php改成了Events.php,如果兩個(gè)環(huán)境不一致會(huì)導(dǎo)致報(bào)Event::onMessage is not callable。所以讓其全部更新到最新版本問題解決。不過此貼是2016年的很老的帖子,已經(jīng)不適用于目前情況。

  • zasray 2019-06-10

    嗯嗯 理解的

年代過于久遠(yuǎn),無法發(fā)表回答
??