walkor / GatewayWorker

Distributed realtime messaging framework based on workerman.
MIT License
1.01k stars 294 forks source link

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

Open yljphp opened 3 years ago

yljphp commented 3 years ago

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 commented 3 years ago

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

zhuwei commented 3 years ago

赞同啊