From 6e92022c375324c9038e60c550416251a5f3365c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Thu, 24 Jun 2021 15:40:11 +0200 Subject: [PATCH] add reconn delay. --- src/component/internal/connection.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/component/internal/connection.ts b/src/component/internal/connection.ts index 173eee31..50e33404 100644 --- a/src/component/internal/connection.ts +++ b/src/component/internal/connection.ts @@ -8,7 +8,10 @@ import { NekoWebRTC, WebRTCStats } from './webrtc' import { Connection } from '../types/state' const websocketTimer = 1000 +const websocketReconnDelay = 750 + const webrtcTimer = 10000 +const webrtcReconnDelay = 750 export interface NekoConnectionEvents { disconnect: (error?: Error) => void @@ -185,7 +188,7 @@ export class NekoConnection extends EventEmitter { this._websocketIsReconnecting = false this._log.debug(`websocket reconnection finished`) - }, 0) + }, websocketReconnDelay) } async _webrtcConnect(video?: string) { @@ -238,7 +241,7 @@ export class NekoConnection extends EventEmitter { this._webrtcIsReconnecting = false this._log.debug(`webrtc reconnection finished`) - }, 0) + }, webrtcReconnDelay) } _webrtcQualityDowngrade(quality: string): string | undefined {