window版本onMessage is not callable

项目写在Linux版本下,按照教程转到window下运行、gatewayWorker,发下onMessage接受不了信息,用webSocket能够连上,也能接受gateway的心跳信息,就是gateway端不能接受web的信息,

php start_register.php start_gateway.php start_businessworker.php start_tcp.php 启动后提示

----------------------- WORKERMAN -----------------------------
Workerman version:3.2.5 PHP version:5.4.16
------------------------ WORKERS -------------------------------
worker listen processes status
Register text://0.0.0.0:1238 1 [OK]
WebsocketGateway Websocket://0.0.0.0:1129 1 [OK]
YourAppBusinessWorker none 1 [OK]
TcpGateway tcp://0.0.0.0:8282 1 [OK]
----------------------------------------------------------------
Press Ctrl-C to quit. Start success.
Waring: Event::onMessage is not callable
微信截图_20160310113504.png
已邀请:

walkor

赞同来自: surechina

这个是因为workerman版本和GatewayWorker版本不一致导致的。
把GatewayWorker和Workerman(win)都更新到最新就好了

wodetian55 - IT

赞同来自: zasray

很遗憾的告诉楼主,其实作者的回复是错的。。。。
正确的修改方式:
找到yourProj下的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://www.workerman.net/
* @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;

// 自动加载类
require_once __DIR__ . '/../../Workerman/Autoloader.php';
Autoloader::setRootPath(__DIR__);


// bussinessWorker 进程
$worker = new BusinessWorker();
// worker名称
$worker->name = 'DemoBusinessWorker';
// bussinessWorker进程数量
$worker->count = 4;
// 服务注册地址
$worker->registerAddress = '127.0.0.1:2688';
// 需要将eventHandler的默认值Events修改成Event就可以了
$worker->eventHandler = 'Event';

// 如果不是在根目录启动,则运行runAll方法
if(!defined('GLOBAL_START'))
{
Worker::runAll();
}

zasray - ITnan

赞同来自:

哈哈 我是来看二楼的

要回复问题请先登录注册