1111
This commit is contained in:
@@ -343,7 +343,7 @@ function AddHeartbeat(ws: WebSocket){
|
|||||||
if (now - (ws as any).lastActivity > 10000) {
|
if (now - (ws as any).lastActivity > 10000) {
|
||||||
console.log('WebSocket connection timeout, closing...');
|
console.log('WebSocket connection timeout, closing...');
|
||||||
clearInterval((ws as any).heartbeatTimer);
|
clearInterval((ws as any).heartbeatTimer);
|
||||||
//ws.close();
|
ws.close();
|
||||||
} else {
|
} else {
|
||||||
// 发送ping消息
|
// 发送ping消息
|
||||||
ws.send(JSON.stringify({ type: "ping" }));
|
ws.send(JSON.stringify({ type: "ping" }));
|
||||||
|
|||||||
Reference in New Issue
Block a user