mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
minor WS &WebRTC fixes.
This commit is contained in:
parent
b6d61c0748
commit
85a3f4fd9d
@ -207,13 +207,11 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
|
|||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
this._log.warn(`unknown data event: ${event}`)
|
this._log.warn(`unknown data event: ${event}`)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
if (typeof buffer !== 'undefined') {
|
|
||||||
this._channel!.send(buffer)
|
this._channel!.send(buffer)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// not-implemented
|
// not-implemented
|
||||||
private onData(e: MessageEvent) {}
|
private onData(e: MessageEvent) {}
|
||||||
@ -250,6 +248,7 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
|
|||||||
|
|
||||||
if (this._statsStop && typeof this._statsStop === 'function') {
|
if (this._statsStop && typeof this._statsStop === 'function') {
|
||||||
this._statsStop()
|
this._statsStop()
|
||||||
|
this._statsStop = undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@
|
|||||||
throw new Error('client not connected to websocket')
|
throw new Error('client not connected to websocket')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.websocket.disconnect()
|
this.websocket.disconnect(new Error('manual action'))
|
||||||
}
|
}
|
||||||
|
|
||||||
public webrtcConnect() {
|
public webrtcConnect() {
|
||||||
@ -361,7 +361,7 @@
|
|||||||
this.webrtc.disconnect()
|
this.webrtc.disconnect()
|
||||||
this.clearState()
|
this.clearState()
|
||||||
|
|
||||||
// reconnect WebRTC
|
// reconnect Websocket
|
||||||
if (this.authenticated) {
|
if (this.authenticated) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user