composer gatewayworker自定义协议报错

0

gatewayworker自定义通讯协议报错


报错信息:


E:\Php\app_sms>php application\worker\start_register.php application\worker\start_gateway.php application\worker\start_businessworker.php
----------------------- WORKERMAN -----------------------------
Workerman version:4.0.12 PHP version:7.3.21
------------------------ WORKERS -------------------------------
worker listen processes status
Register text://0.0.0.0:1238 1 [ok]


Fatal error: Uncaught Exception: class \Protocols\Sms not exist in E:\Php\app_sms\vendor\workerman\workerman\Worker.php:2319
Stack trace:
.#0 E:\Php\app_sms\vendor\workerman\workerman\Worker.php(2212): Workerman\Worker->parseSocketAddress()
.#1 E:\Php\app_sms\vendor\workerman\gateway-worker\src\Gateway.php(239): Workerman\Worker->construct('sms://0.0.0.0:8...', Array)
.#2 E:\Php\app_sms\application\worker\start_gateway.php(24): GatewayWorker\Gateway->
construct('sms://0.0.0.0:8...')
.#3 {main}
thrown in E:\Php\app_sms\vendor\workerman\workerman\Worker.php on line 2319
SmsBusinessWorker none 4 [ok]
process E:\Php\app_sms\application\worker\start_gateway.php terminated and try to restart


版本信息:


E:\Php\app_sms>composer show workerman/gateway-worker -i
You are using the deprecated option "installed". Only installed packages are shown by default now. The --all option can be used to show all packages.
name : workerman/gateway-worker
descrip. :
keywords : communication, distributed
versions : * v3.0.18
type : library
license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage : http://www.workerman.net
source : [git] https://github.com/walkor/GatewayWorker.git 50d3a77deb7f7fb206d641ee0307ae1c41d5d41d
dist : [zip] https://api.github.com/repos/walkor/GatewayWorker/zipball/50d3a77deb7f7fb206d641ee0307ae1c41d5d41d 50d3a77deb7f7fb206d641ee0307ae1c41d5d41d
path : E:\Php\app_sms\vendor\workerman\gateway-worker
names : workerman/gateway-worker


autoload
psr-4
GatewayWorker\ => ./src


requires
workerman/workerman >=3.5.0


E:\Php\app_sms>composer show workerman/workerman -i
You are using the deprecated option "installed". Only installed packages are shown by default now. The --all option can be used to show all packages.
name : workerman/workerman
descrip. : An asynchronous event driven PHP framework for easily building fast, scalable network applications.
keywords : asynchronous, event-loop
versions : * v4.0.12
type : library
license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage : http://www.workerman.net
source : [git] https://github.com/walkor/Workerman.git 34abfc8550d669965b8a157001fe23a9785fdefc
dist : [zip] https://api.github.com/repos/walkor/Workerman/zipball/34abfc8550d669965b8a157001fe23a9785fdefc 34abfc8550d669965b8a157001fe23a9785fdefc
path : E:\Php\app_sms\vendor\workerman\workerman
names : workerman/workerman


autoload
psr-4
Workerman\ => ./


requires
php >=5.3


suggests
ext-event For better performance.


E:\Php\app_sms>


目录结构:


截图


另外我之前有一个类似项目,但是workerman的版本号时v4.0.10,工作正常,自定义的通讯协议正常工作。我把之前项目vendor/workerman/目录复制到新项目中替换掉新项目也能正常工作了。但是还是想知道新版本怎么样解决这个问题....

已邀请:

MicroStudio - MicroStudio

赞同来自:

我自己暂时解决办法是:
1.composer create-project topthink/think=5.1. web_sms
2.composer require workerman/gateway-worker
3.composer require workerman/workerman 4.0.10
通过composer正常安装后,再将workerman版本降级到4.0.10。虽然现在能正常使用,但是感觉这样不妥,不知道4.0.13是不是对自定义通讯协议实现方式是否有变更,现有找到的资料不知道如何解决,期待作者大佬帮忙解决一下。

walkor

赞同来自:

更新到4.0.14或者以后的更高版本试下

要回复问题请先登录注册