Gateway Client组件每隔段时间自动提示错误信息

笑天

原文:

Warning: stream_socket_client(): unable to connect to tcp://10.5.0.4:1238 (Connection timed out) in /home/mail/GatewayWorker/Lib/Gateway.php on line 676
exception 'Exception' with message 'Can not connect to tcp://10.5.0.4:1238 Connection timed out' in /home/mail/GatewayWorker/Lib/Gateway.php:678
Stack trace:
#0 /home/mail/GatewayWorker/Lib/Gateway.php(632): GatewayWorker\Lib\Gateway::getAllGatewayAddressesFromRegister()
#1 /home/mail/GatewayWorker/Lib/Gateway.php(443): GatewayWorker\Lib\Gateway::sendToAllGateway(Array)
#2 /home/mail/Application/Betting/start_report.php(42): GatewayWorker\Lib\Gateway::sendToGroup('S30fa0ca58433', '{"action":"Pro"...')
#3 : {closure}(Object(Workerman\Connection\TcpConnection), '{"type":"toAll"...')
#4 /home/mail/Workerman/Connection/TcpConnection.php(422): call_user_func(Object(Closure), Object(Workerman\Connection\TcpConnection), '{"type":"toAll"...')
#5 : Workerman\Connection\TcpConnection->baseRead(Resource id #198531)
#6 /home/mail/Workerman/Events/Select.php(250): call_user_func_array(Array, Array)
#7 /home/mail/Workerman/Worker.php(1472): Workerman\Events\Select->loop()
#8 /home/mail/Workerman/Worker.php(900): Workerman\Worker->run()
#9 /home/mail/Workerman/Worker.php(866): Workerman\Worker::forkOneWorker(Object(Workerman\Worker))
#10 /home/mail/Workerman/Worker.php(1018): Workerman\Worker::forkWorkers()
#11 /home/mail/Workerman/Worker.php(425): Workerman\Worker::monitorWorkers()
#12 /home/mail/start_business.php(57): Workerman\Worker::runAll()
#13 {main}2016-09-03 17:18:33 WORKER EXIT UNEXPECTED 
2016-09-03 17:18:33 worker exit with status 64000

使用官方给的gateway client组件.

5462 1 0
1个回答

damao

Warning: stream_socket_client(): unable to connect to tcp://10.5.0.4:1238 (Connection timed out)

应该是你的服务器到10.5.0.4:1238的网络不通,这个地址是你在start_gateway.php start_businessworker.php中通过$registerAddress设置的。

出现这个问题原因:
1、通常是10.5.0.4这个服务器防火墙把1238的端口挡住了。
2、你的ip配置错了,这个ip根本不存在
3、这个ip不在一个内网里,访问不到

总之是你自己的问题,哈哈哈

年代过于久远,无法发表回答
×
🔝