国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

thinkphp6 阿里云 stream_socket_client(): unable to

w5w4

問(wèn)題描述

之前部署過(guò)好幾個(gè)gatewayworker + thinkphp+ 第一次出現(xiàn)這種問(wèn)題
1. (我只是一臺(tái)服務(wù)器 沒(méi)做分布式)
2. 第一次用阿里云服務(wù)器搭建
thinkphp bindUid的時(shí)候就提示
stream_socket_client(): unable to connect to tcp://127.0.0.1:29** (Connection refused)
php start.php status
php start.php start
php start.php start -d 都沒(méi)問(wèn)題
直接通過(guò)webscket聊天也沒(méi)問(wèn)題
但是通過(guò)GatewayClient\Gateway就報(bào)錯(cuò) 大佬們遇到過(guò)嗎

start_register.php:

<?php 
/**
 * This file is part of workerman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link http://m.wtbis.cn/
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
 */
use \Workerman\Worker;
use \GatewayWorker\Register;

// 自動(dòng)加載類
require_once __DIR__ . '/../../vendor/autoload.php';

// register 必須是text協(xié)議
$register = new Register('text://0.0.0.0:1238');

// 如果不是在根目錄啟動(dòng),則運(yùn)行runAll方法
if(!defined('GLOBAL_START'))
{
    Worker::runAll();
}

thinkphp

<?php

namespace app\api\controller;

use app\api\service\file\UploadService;
use app\api\service\user\UserLogService;
use app\api\service\user\UserService;
use GatewayClient\Gateway;
use think\facade\Request;

class User extends Base
{
    public function bind()
    {
        Gateway::$registerAddress = "127.0.0.1:1238";
        Gateway::sendToAll("11111"); //這里不會(huì)報(bào)錯(cuò)但是沒(méi)發(fā)送成功
        Gateway::bindUid(Request::param('client_id'), 1);
        return msg(Request::param('client_id'));
    }
}
2222 4 0
4個(gè)回答

Gin

Gateway::$registerAddress = "127.0.0.1:1238"; 127.0.0.1 換成服務(wù)器的內(nèi)網(wǎng)地址 試試

  • w5w4 2023-03-29

    還是不行 換了局域網(wǎng)IP 還是提示 unable to connect to tcp://127.0.0.1:2918 (Connection refused)

  • Gin 2023-03-29

    確定 gatewayworker 是啟動(dòng)著的?

  • w5w4 2023-03-29

    是的
    php start.php status 正常的
    php start.php start 控制臺(tái)沒(méi)報(bào)錯(cuò)
    php start.php start -d 都沒(méi)問(wèn)題
    websocket也沒(méi)問(wèn)題正常使用

  • yongdao35 2023-03-29

    client_id 里包含了一些ip及端口信息,如果client_id是錯(cuò)的,就會(huì)有這個(gè)問(wèn)題

yongdao35

http://m.wtbis.cn/doc/gateway-worker/work-with-other-frameworks.html#%E5%85%B3%E4%BA%8EGatewayClient

手冊(cè)說(shuō)如果GatewayClient和GatewayWorker不是在同一臺(tái)服務(wù)器上,則需要先將start_gateway.php中的lanIp改成當(dāng)前服務(wù)器的內(nèi)網(wǎng)ip??纯词遣皇沁@個(gè)問(wèn)題

  • w5w4 2023-03-29

    我在一臺(tái)服務(wù)器。。 而且我改成了內(nèi)網(wǎng)ip也不行

  • w5w4 2023-03-29

    謝謝 我剛才測(cè)試了 真有可能是 client_id的問(wèn)題 我Android studio 那邊返回的ID格式是 7f0000010b6600040ae3 就會(huì)報(bào)錯(cuò)
    但是我用其他方式返回的ID格式是 ac13c7ce0fa000000002 就不會(huì)報(bào)錯(cuò)
    應(yīng)該是這個(gè)原因 我再看看 感謝你

w5w4

剛剛換成局域網(wǎng)IP  也不行

  • w5w4 2023-03-29

    剛剛緩存局域網(wǎng)ip 也不行

  • w5w4 2023-03-29

    -換成

w5w4

占用大家的網(wǎng)絡(luò)資源和時(shí)間非常抱歉
這個(gè)就是client_id 不存在導(dǎo)致的

導(dǎo)致這樣的原因是。。。。
服務(wù)器太多了 Android Studio填錯(cuò)ws IP了 = =

年代過(guò)于久遠(yuǎn),無(wú)法發(fā)表回答
??