|
@@ -95,7 +95,7 @@ class HcSocket {
|
|
|
while (attempts < this.limit && !this.isSocket() && !this.isManualClosed) {
|
|
|
console.log(`重新链接中... (${attempts + 1}/${this.limit})`)
|
|
|
this.create()
|
|
|
- await new Promise(resolve => setTimeout(resolve, this.getReconnectInterval(attempts)))
|
|
|
+ await new Promise(resolve => setTimeout(resolve, this.interval))
|
|
|
attempts++
|
|
|
}
|
|
|
|
|
@@ -105,11 +105,6 @@ class HcSocket {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 指数退避策略
|
|
|
- getReconnectInterval(attempt) {
|
|
|
- return Math.min(1000 * Math.pow(2, attempt), this.interval)
|
|
|
- }
|
|
|
-
|
|
|
handleMultipleTabs() {
|
|
|
document.addEventListener('visibilitychange', this.handleVisibilityChange.bind(this))
|
|
|
}
|