[分享]两行代码实现GatewayWorker支持redis认证

1、在GatewayWorker/Lib/Store.php大概在84行下添加一行代码:self::$instance->auth(\Config\Store::$redis_auth); 2、在Applications/YourApp/Config/Store.php大概在52行下添加一行代码:public static $redis_auth = ""; 具体代码如下: GatewayW...

294194253 发表与 2015-10-17 5028 浏览 1 回答
Address already in use

$ php start.php start PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mcrypt.so' - /usr/lib64/php/modules/php_mcrypt.so: cannot open shared object file: No such file or ...

yayaigo 发表与 2015-10-16 9031 浏览 4 回答
workerman 如何设置内存极限值

这是报错信息: WORKER EXIT UNEXPECTED E_ERROR Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) in /opt/workerman/GatewayWorker/Lib/StoreDriver/File.php on line 74 134217728换算过来是128M,代码原因...

skl_TZ 发表与 2015-10-16 7996 浏览 1 回答
关于workerman单进程的问题

请问下我想在不同的房间类型: 休闲房、竞技房 , 下面有对应的不同金币的房间,金币房间下面有很多桌,每桌4个玩家。 客户端只传进房间 的类型 和对应的金币房id,桌子编号由服务端决定,玩家进入时自动分配到桌上。我想根据不同的房间类型 启动多个实例,是不是我客户端登录的时候连接一个实例,选择房间类型的时候,根据不同的类型再 重新连接对应的实例。...

redyn 发表与 2015-10-16 4427 浏览 2 回答
IE兼容socket 路由重写问题

请教walkor与大家一个浏览器兼容问题 ,我的项目中使用getwayworker做socket通信 ,在IE下是不支持socket ,我看了文档 ,把swf文件与swfobject.js与web_socket.js都加载进去 ,如果路由没有重写(ceshi.blogchin.com/home.php/blog/home/uname/hfhuobing),这样访问是正常的, 但如果我的路由重写了(ceshi.blo...

13141223060 发表与 2015-10-11 5456 浏览 10 回答
workerman如何使用xdebug调试

workerman如何使用xdebug调试,workerman确实优秀,但是由于现在的业务逻辑较为复杂,代码量大,需要xdebug调试,麻烦各位,如何xdebug多线程调试,谢谢了...

tom200469 发表与 2015-10-11 9257 浏览 3 回答
异步中也获取不到$_SERVER['REMOTE_ADDR']?

...

lichao 发表与 2015-10-06 7431 浏览 1 回答
异步中的session在gateway中获取不到?

我的登录是走的异步,登录成功后把userid存入$_SESSION中,然后用户发布消息,在主进程中获取$_SESSION,但是在主进程中这个$_SESSION获取不到,为什么?怎么才可以获取到?...

lichao 发表与 2015-10-05 4827 浏览 1 回答
异步回调中调用主进程?

$task = new AsyncTcpConnection('Text://127.0.0.1:8281'); $task->connect(); $task_data = array( 'function'=>'login', 'args'=>$args, ); $ta...

lichao 发表与 2015-10-04 3767 浏览 4 回答
开启异步AsyncTcpConnection,异步处理数据,防止主干道阻塞?

<?php use \GatewayWorker\Lib\Gateway; use \Workerman\Worker; use \Workerman\Connection\AsyncTcpConnection; use \Applications\YourApp\Controller\MyWm; use \Applications\YourApp\Database\MySql; require_once _...

lichao 发表与 2015-10-03 5633 浏览 1 回答
怎么在定时器内部关闭自身定时器?

问题: 我发送一个信息,要求在明天中午12:00点,发给所有在线用户,然后关闭此定时器。, 我的实现: $time_interval =60; \Workerman\Lib\Timer::add($time_interval, function($info,$onlinetime) { if(time()>=$onlinetime) { $info=json_encode($in...

lichao 发表与 2015-10-02 6053 浏览 3 回答
定时器传参

$time_interval =3; $aa='1'; $aa='2'; \Workerman\Lib\Timer::add($time_interval, function($aa){print_r($aa);},$aa,true); 我传入的是$aa一个数组,但是打印出来一个值。外部传参,怎么传,我的方式对吗?...

lichao 发表与 2015-10-02 3623 浏览 1 回答
workerman接口安全

$class = $message_data;//类 $method = $message_data;//方法 $args = $message_data;//参数 if(file_exists(__DIR__.'/Controller/'.$class.'.class.php')) { require_once __DIR__.'/Controller/'.$...

lichao 发表与 2015-09-30 5501 浏览 1 回答
worker进程数设置

workerman模型中,如果由于worker进程数设置不够,可能会导致新来的请求无法及时处理吗?会发生什么情况?(不讨论AsyncTcpConnection那种方案)主要是想了解会有queue吗?这部分是wm处理还是系统处理?因为有时候worker可能只是某一时会不够,大多数时没问题,设置太大不好。...

aguai 发表与 2015-09-28 7447 浏览 2 回答
配置redis时,无法找到redis类,我确认已经安装redis扩展和redis服务器

启动时出错了 Fatal error: Class 'Redis' not found in /alidata/www/GatewayWorker/GatewayWorker/Lib/StoreDriver/Redis.php on line 21 WORKER EXIT UNEXPECTED E_ERROR Class 'Redis' not found in /alidata/www/GatewayWorker/...

h8h8 发表与 2015-09-23 7928 浏览 3 回答
关于start.php中的onConnect回调函数与event::onConnect的区别

发现在start.php中 $gateway->onConnect = function($connection) {...} 的回调函数中,使用memcached设置的缓存在 Event::onConnect($client_id) 中访问不到,必须用usleep(100000);休眠0.1毫秒才可以。 对于workerman的模型理解得不是很透彻,请问这两个函数是怎样的触发方式和顺序? 另外我了解到,wor...

fdream 发表与 2015-09-22 4008 浏览 1 回答
在timer中sendToClient浏览器不知道为什么接收不到

[attach]153[/attach] 页面上输出的clientid 和我event打印出来的是一样的, 可是我的浏览器就是没有输出 不知道哪里错了。...

雨儿 发表与 2015-09-22 4781 浏览 7 回答
关于安装分布式统计系统

下载了分布式统计系统的包安装成功了,并成功启动服务, 但是用http访问55757端口的时候,游戏器一直在转。有人遇到这样的问题吗?请问是什么原因? [attach]149[/attach] [attach]150[/attach]...

lchubin 发表与 2015-09-21 3086 浏览 1 回答
gw的外部存贮模式

gw是将连接关系信息保存在外部存贮上,为什么不单独建一个特别进程保存这些信息,gateway与worker专门与这个进程通讯即可,这样框架就不依赖外部实现?...

aguai 发表与 2015-09-19 2962 浏览 1 回答

walkor

163361
积分
0
获赞数
0
粉丝数
2014-05-04 加入
🔝