|
|
@ -82,11 +82,11 @@ class WebSocketClient { |
|
|
|
if (this.reconnectAttempts === -1) { |
|
|
|
this.reconnectAttempts = 0; |
|
|
|
} |
|
|
|
if (this.reconnectAttempts >= this.maxReconnectAttempts) { |
|
|
|
console.log("达到最大重连次数,停止重连"); |
|
|
|
this.reconnectAttempts = -1; |
|
|
|
return; |
|
|
|
} |
|
|
|
// if (this.reconnectAttempts >= this.maxReconnectAttempts) {
|
|
|
|
// console.log("达到最大重连次数,停止重连");
|
|
|
|
// this.reconnectAttempts = -1;
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
console.log(`尝试第 ${this.reconnectAttempts + 1} 次重连...`); |
|
|
|