unable to connect to tcp://0.0.0.0:8787

stamhu

问题描述

我在项目中生成了多个Worker任务文件,如果通过http(nginx)接口去启动对应的任务,然后重启项目就会报端口被占用,,,,手动命令行去启动这些任务,就可以重启项目

报错信息

tream_socket_server(): unable to connect to tcp://0.0.0.0:8787 (Address already in use) in file /www/wwwroot/pre/gfff_iot/vendor/workerman/workerman/Worker.php on line 2360
PHP Fatal error:  Uncaught Exception: Address already in use in /www/wwwroot/pre/gfff_iot/vendor/workerman/workerman/Worker.php:2362
Stack trace:
#0 /www/wwwroot/pre/gfff_iot/vendor/workerman/workerman/Worker.php(700): Workerman\Worker->listen()
#1 /www/wwwroot/pre/gfff_iot/vendor/workerman/workerman/Worker.php(555): Workerman\Worker::initWorkers()
#2 /www/wwwroot/pre/gfff_iot/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
#3 /www/wwwroot/pre/gfff_iot/start.php(4): support\App::run()
#4 {main}
  thrown in /www/wwwroot/pre/gfff_iot/vendor/workerman/workerman/Worker.php on line 2362

Fatal error: Uncaught Exception: Address already in use in /www/wwwroot/pre/gfff_iot/vendor/workerman/workerman/Worker.php:2362
Stack trace:
#0 /www/wwwroot/pre/gfff_iot/vendor/workerman/workerman/Worker.php(700): Workerman\Worker->listen()
#1 /www/wwwroot/pre/gfff_iot/vendor/workerman/workerman/Worker.php(555): Workerman\Worker::initWorkers()
#2 /www/wwwroot/pre/gfff_iot/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
#3 /www/wwwroot/pre/gfff_iot/start.php(4): support\App::run()
#4 {main}
  thrown in /www/wwwroot/pre/gfff_iot/vendor/workerman/workerman/Worker.php on line 2362
1103 1 0
1个回答

stamhu

我换了一个思路,把http的请求参数扔到队列,让队列去执行启动,停止任务,这样就没有影响了....

  • 暂无评论
年代过于久远,无法发表回答
×
🔝