mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add reconn delay.
This commit is contained in:
parent
6a8255d08a
commit
6e92022c37
@ -8,7 +8,10 @@ import { NekoWebRTC, WebRTCStats } from './webrtc'
|
|||||||
import { Connection } from '../types/state'
|
import { Connection } from '../types/state'
|
||||||
|
|
||||||
const websocketTimer = 1000
|
const websocketTimer = 1000
|
||||||
|
const websocketReconnDelay = 750
|
||||||
|
|
||||||
const webrtcTimer = 10000
|
const webrtcTimer = 10000
|
||||||
|
const webrtcReconnDelay = 750
|
||||||
|
|
||||||
export interface NekoConnectionEvents {
|
export interface NekoConnectionEvents {
|
||||||
disconnect: (error?: Error) => void
|
disconnect: (error?: Error) => void
|
||||||
@ -185,7 +188,7 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
|
|||||||
|
|
||||||
this._websocketIsReconnecting = false
|
this._websocketIsReconnecting = false
|
||||||
this._log.debug(`websocket reconnection finished`)
|
this._log.debug(`websocket reconnection finished`)
|
||||||
}, 0)
|
}, websocketReconnDelay)
|
||||||
}
|
}
|
||||||
|
|
||||||
async _webrtcConnect(video?: string) {
|
async _webrtcConnect(video?: string) {
|
||||||
@ -238,7 +241,7 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
|
|||||||
|
|
||||||
this._webrtcIsReconnecting = false
|
this._webrtcIsReconnecting = false
|
||||||
this._log.debug(`webrtc reconnection finished`)
|
this._log.debug(`webrtc reconnection finished`)
|
||||||
}, 0)
|
}, webrtcReconnDelay)
|
||||||
}
|
}
|
||||||
|
|
||||||
_webrtcQualityDowngrade(quality: string): string | undefined {
|
_webrtcQualityDowngrade(quality: string): string | undefined {
|
||||||
|
Loading…
Reference in New Issue
Block a user