GatewayWorker icon indicating copy to clipboard operation
GatewayWorker copied to clipboard

客户端发送$opcode === 0x9时,为什么不把当前连接的pingNotResponseCount = -1呢?

Open yljphp opened this issue 3 years ago • 2 comments


if ($opcode === 0x9) {
    if ($recv_len >= $current_frame_length) {
        //****
    } else {
        //为什么不添加此行呢?
        $connection->pingNotResponseCount = -1;
        $connection->send($ping_data);
    }
    $connection->websocketType = $tmp_connection_type;
    if ($recv_len > $current_frame_length) {
        return static::input(\substr($buffer, $current_frame_length), $connection);
    }
 }

yljphp avatar May 20 '21 08:05 yljphp

添加此行,客户端无需定时发送opcode = 0x1 的普通消息

yljphp avatar May 20 '21 08:05 yljphp

赞同啊

zhuwei avatar Jun 08 '21 12:06 zhuwei