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

GatewayWorker給對(duì)方發(fā)送不出消息

嘻嘻哈哈

GatewayWorker給對(duì)方發(fā)送不出消息

tcpdump抓包可以看到對(duì)方向我傳輸?shù)南?,但是但是就是發(fā)不出去,onmessage也沒(méi)進(jìn)入

我現(xiàn)在給對(duì)方強(qiáng)制下線(xiàn)也無(wú)效,消息根本就發(fā)送不出去,一直顯示客戶(hù)端在線(xiàn)

這是抓包信息
12:49:44.869009 IP 103.43.71.160.53438 > 172.17.251.248.80: Flags [P.], seq 3425:3450, ack 1, win 0, options [nop,nop,TS val 3456180314 ecr 3592720976], length 25
$..S...................Pi.
.. Z.$.P......{"ping":1753418984}
12:49:44.869012 IP 172.17.251.248.80 > 103.43.71.160.53438: Flags [.], ack 3450, win 122, options [nop,nop,TS val 3592730708 ecr 3456180314], length 0
=...zoG.........g+G..P....S.i.
.$.T.. Z
12:49:54.625646 IP 103.43.71.160.53438 > 172.17.251.248.80: Flags [P.], seq 3450:3475, ack 1, win 0, options [nop,nop,TS val 3456190070 ecr 3592730708], length 25
=..S...................Pi.
..Fv.$.T......{"ping":1753418994}
12:49:54.625652 IP 172.17.251.248.80 > 103.43.71.160.53438: Flags [.], ack 3475, win 122, options [nop,nop,TS val 3592740465 ecr 3456190070], length 0
V...z"..........g+G..P....S.i.
.$.q..Fv
12:49:59.489229 IP 103.43.71.160.53438 > 172.17.251.248.80: Flags [P.], seq 3475:3500, ack 1, win 0, options [nop,nop,TS val 3456194934 ecr 3592740465], length 25
V..S......~............Pi.
..Yv.$.q......{"ping":1753418999}
12:49:59.489236 IP 172.17.251.248.80 > 103.43.71.160.53438: Flags [.], ack 3500, win 122, options [nop,nop,TS val 3592745328 ecr 3456194934], length 0
o...z...........g+G..P....S.i.
.$.p..Yv

這是onmessage,onmessage消息都打印不出來(lái)。
public static function onMessage($client_id, $message)
{
//格式:{"Key":"PMAU,HSI"} {"ping":10位時(shí)間戳}

    $data = json_decode($message, true);

    //心跳檢測(cè)
    if(isset($data['ping']) && !empty($data['ping'])) {
        $currentTime = time();

        // 檢查是否超過(guò)心跳間隔
        if (!isset(self::$lastHeartbeatTime[$client_id]) || ($currentTime - self::$lastHeartbeatTime[$client_id] >= self::$heartbeatInterval)) {
            self::$lastHeartbeatTime[$client_id] = $currentTime; // 更新心跳時(shí)間
            Gateway::sendToClient($client_id, json_encode(['pong' => $currentTime]));
        }

        $ip_list = Gateway::getSession($client_id);
        if(!empty($ip_list)) {
            $ip = $ip_list['ip'];
            echo "IP【".$ip."】client_id心跳檢測(cè)【".$client_id."】".PHP_EOL;
        }

        return;
    }
}

我現(xiàn)在給對(duì)方強(qiáng)制下線(xiàn)也無(wú)效,消息根本就發(fā)送不出去,一直顯示客戶(hù)端在線(xiàn)

use \GatewayWorker\Lib\Gateway;

Gateway::$registerAddress = '127.0.0.1:1233';

$client_id = "7f0000010b5400000050";
// 檢查客戶(hù)端是否在線(xiàn)
if(Gateway::isOnline($client_id)) {
echo "客戶(hù)端在線(xiàn)";
} else {
echo "客戶(hù)端不在線(xiàn)";
}

//Gateway::sendToClient("7f0000010b540000005e",json_encode(['pong' => 111111111111111111111111111111111111111111111111111111111111111111111111]));

Gateway::closeClient($client_id);

140 1 0
1個(gè)回答

嘻嘻哈哈

和使用nginx代理有關(guān)系嗎?但是其他客戶(hù)端能正常收到消息

server
{
listen 80;
server_name 127.0.0.1;
index index.html index.htm index.php;

    location /ws {
      proxy_pass http://0.0.0.0:8888;
      proxy_read_timeout 365d;

      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
    }
    access_log  /www/wwwlogs/access.log;
}
  • 暫無(wú)評(píng)論
??