Comments (7)
客户端指的是正常的客户端,不是GatewayClient。
如果不影响你的程序,忽略即可。
from gatewayclient.
想起来了,我每回第一次调用 \GatewayClient\Gateway::XXX 方法的时候,都会抛出错误:
getAllGatewayAddressesFromRegister fail. tcp://xx.xx.xx.xx:1238 return false
我是自己加了个异常捕获,捕获之后再请求一次就没问题。准确地说是之后 10s 内的其它请求没有问题了。貌似就是第一次请求的失败引出了 Register auth timeout
这个错误。
然后我看 workerman/gateway-worker/src/Register.php
的源码里有个 10s 的定时器,不知道这个跟第一次请求失败有什么关联,想请教一下。
/**
* 设置个定时器,将未及时发送验证的连接关闭
*
* @param \Workerman\Connection\ConnectionInterface $connection
* @return void
*/
public function onConnect($connection)
{
$connection->timeout_timerid = Timer::add(10, function () use ($connection) {
self::log("Register auth timeout (".$connection->getRemoteIp()."). See http://wiki.workerman.net/Error4 for detail");
$connection->close();
}, null, false);
}
from gatewayclient.
php start.php status
贴下
from gatewayclient.
这是正在跑的三个模块的状态:
Workerman[start_register.php] status
---------------------------------------GLOBAL STATUS--------------------------------------------
Workerman version:3.3.9 PHP version:5.6.9
start time:2017-04-20 10:13:31 run 0 days 0 hours
load average: 0, 0.01, 0.05 event-loop:React
1 workers 1 processes
worker_name exit_status exit_count
Register 0 0
---------------------------------------PROCESS STATUS-------------------------------------------
pid memory listening worker_name connections total_request send_fail throw_exception
14345 1.5M text://0.0.0.0:1238 Register 14 20 0 0
Workerman[start_gateway.php] status
---------------------------------------GLOBAL STATUS--------------------------------------------
Workerman version:3.3.9 PHP version:5.6.9
start time:2017-04-20 10:13:36 run 0 days 0 hours
load average: 0, 0.01, 0.05 event-loop:React
1 workers 4 processes
worker_name exit_status exit_count
AddMe 0 0
---------------------------------------PROCESS STATUS-------------------------------------------
pid memory listening worker_name connections total_request send_fail throw_exception
14350 2M websocket://0.0.0.0:8282 AddMe 11 41 0 0
14349 2M websocket://0.0.0.0:8282 AddMe 10 69 0 0
14351 2M websocket://0.0.0.0:8282 AddMe 9 67 0 0
14352 2M websocket://0.0.0.0:8282 AddMe 9 46 0 0
Workerman[start_businessworker.php] status
---------------------------------------GLOBAL STATUS--------------------------------------------
Workerman version:3.3.9 PHP version:5.6.9
start time:2017-04-20 10:13:42 run 0 days 0 hours
load average: 0, 0.01, 0.05 event-loop:React
1 workers 8 processes
worker_name exit_status exit_count
YourAppBusinessWorker 0 0
---------------------------------------PROCESS STATUS-------------------------------------------
pid memory listening worker_name connections total_request send_fail throw_exception
14361 2.25M none YourAppBusinessWorker 5 73 0 0
14356 2.25M none YourAppBusinessWorker 5 73 0 0
14359 3M none YourAppBusinessWorker 5 78 0 0
14362 2.25M none YourAppBusinessWorker 5 73 0 0
14360 3M none YourAppBusinessWorker 5 85 0 0
14358 2.25M none YourAppBusinessWorker 5 77 0 0
14357 3M none YourAppBusinessWorker 5 101 0 0
14363 3M none YourAppBusinessWorker 5 105 0 0
from gatewayclient.
我打印了下 workerman/gatewayclient/Gateway.php
里 getAllGatewayAddressesFromRegister
方法里一些网络调用的结果。
第一次运行,$client
返回的是一个资源 resource(4) of type (stream)
,但是 $ret
是 false
,就报错了;第二次运行正常。
from gatewayclient.
ReactPHP的一个bug导致的,安装个event扩展就好了。回头我手册说明下。
http://wenda.workerman.net/?/question/1828
from gatewayclient.
好的,多谢!
from gatewayclient.
Related Issues (20)
- 前端异常掉线,GatewayClient如何感知 HOT 1
- 建议把 self::$registerAddress 改成 static::$registerAddress HOT 2
- 关于Gateway类中的secretKey 说明 HOT 2
- 升级测试3.0.0升级到3.0.9不能绑定uid,返回null HOT 6
- constant spell wrong HOT 1
- PHP Warning: pack(): Type H: illegal hex digit HOT 3
- Fatal error: in ../../Gateway.php on line 1286 HOT 3
- Can not connect to tcp://127.0.0.1:1236 Connection refused HOT 2
- GatewayWorker 使用的是3.0.12版本 PHP 5.6.31 安装时报如下错误: composer require workerman/gatewayclient HOT 1
- How can I send messages to different server in one request ? HOT 1
- 权限验证怎么做? HOT 3
- memory leak problem
- 使用client循环到注册中心去取数据有时候会报错 HOT 2
- GatewayClient使用Gateway::getUidListByGroup报错 HOT 1
- 使用GatewayClient的时候报错,本来好好的,不知道为啥突然报错了。、 HOT 1
- 在一次http接口请求中执行多次sendToUid报错 HOT 1
- 容器端口映射后,通过宿主机ip访问会出错,不兼容!
- 大佬 把 gateway.php的 19行 版本改一下吧 HOT 1
- strlen() expects parameter 1 to be string, array given HOT 1
- Windows+WSL开发环境
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatewayclient.