【m】状态同步

This commit is contained in:
zhangzheng
2026-03-12 17:53:34 +08:00
parent 7b92f69d6a
commit 4ce99ae140
5 changed files with 93 additions and 23 deletions

View File

@@ -336,7 +336,7 @@ function onCandidate(ws: WebSocket, message: any): void {
onDisconnect(ws, connectionId);
} else {
// 发送ping消息
ws.send(JSON.stringify({ type: "ping" }));
ws.send(JSON.stringify({ from: connectionId, to: "", type: "on-message", data: { type: "ping"} }));
console.log('WebSocket connection heartbeat, lastActivity: ', (ws as any).lastActivity);
}
}, 3000);