stream_socket_server(): unable to connect to tcp://45.92.08.22:1238 (Cannot assign requested address) in file /home/www/chaobiao.dazongqiba.top/vendor/workerman/workerman/Worker.php on line 2178
我是直接在网上下载的GatewayWorker文件夹,我是在Event.php文件做逻辑判断的,其次就是修改了start_businessworker和start_gateway的服务注册地址为0.0.0.0:1238,start_register的text协议为Linux服务器的ip。默认的启动文件start.php的代码:
ini_set('display_errors', 'on');
use Workerman\Worker;
if(strpos(strtolower(PHP_OS), 'win') === 0)
{
exit("start.php not support windows, please use start_for_win.bat\n");
}
我是在Linux操作的,如果是127.0.0.1,会报错SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready。客服那边的给我的恢复是http://wiki.workerman.net/Error3
API接口都是用http协议吧,gatewayWorker好像不支持直接用http调用。
好的,谢谢您的回复!
请问出现Cannot assign requested address这个现象的时候,修改的是哪个启动文件?
参考手册里的text协议,里面说明的文件 start_text_gateway.php
ok,谢谢您的回复!
请问出现Cannot assign requested address这个现象的时候,修改的是哪个启动文件?
@5023:应该是路径不对吧,ni看我发的,不过我是在windows上跑的
我是在liunx上跑的,我现在是启动GatewayWorker里面的start.php 文件就报错了
stream_socket_server(): unable to connect to tcp://45.92.08.22:1238 (Cannot assign requested address) in file /home/www/chaobiao.dazongqiba.top/vendor/workerman/workerman/Worker.php on line 2178
监听地址用0.0.0.0:1238就好了
我是直接在网上下载的GatewayWorker文件夹,我是在Event.php文件做逻辑判断的,其次就是修改了start_businessworker和start_gateway的服务注册地址为0.0.0.0:1238,start_register的text协议为Linux服务器的ip。默认的启动文件start.php的代码:
ini_set('display_errors', 'on');
use Workerman\Worker;
if(strpos(strtolower(PHP_OS), 'win') === 0)
{
exit("start.php not support windows, please use start_for_win.bat\n");
}
// 检查扩展
if(!extension_loaded('pcntl'))
{
exit("Please install pcntl extension. See http://doc3.workerman.net/appe ... .html\n");
}
if(!extension_loaded('posix'))
{
exit("Please install posix extension. See http://doc3.workerman.net/appe ... .html\n");
}
// 标记是全局启动
define('GLOBAL_START', 1);
require_once __DIR__ . '/vendor/autoload.php';
// 加载所有Applications//start.php,以便启动所有服务
foreach(glob(__DIR__.'/Applications//start*.php') as $start_file)
{
require_once $start_file;
}
// 运行所有服务
Worker::runAll();
我改成这样才能运行
我现在把start_businessworker.php、start_gateway.php的服务注册地址的ip都设置为0.0.0.0,start_register.php的ip为服务器的ip,结果启动start.php 文件的时候就报Cannot assign requested address
@5023:为什么设置0.0.0.0 我都是用127.0.0.1的,没试过
我是在Linux操作的,如果是127.0.0.1,会报错SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready。客服那边的给我的恢复是http://wiki.workerman.net/Error3
你那边跑通的start_businessworker.php、start_gateway.php的服务注册地址的ip设置为多少的?start_register.php的ip为设置多少?