Trigg a disconnect event when keepalive signal lost
You will have to wait for DISCONNECT_TIMEOUT time berfore receiving event
This commit is contained in:
parent
062fb7d203
commit
e3178bb61d
|
|
@ -91,7 +91,7 @@ const extendedClipboardActionProvide = 1 << 28;
|
||||||
export default class RFB extends EventTargetMixin {
|
export default class RFB extends EventTargetMixin {
|
||||||
constructor(target, urlOrChannel, options) {
|
constructor(target, urlOrChannel, options) {
|
||||||
if (!target) {
|
if (!target) {
|
||||||
throw new Error("Must specify target");
|
throw new ("Must specify target");
|
||||||
}
|
}
|
||||||
if (!urlOrChannel) {
|
if (!urlOrChannel) {
|
||||||
throw new Error("Must specify URL, WebSocket or RTCDataChannel");
|
throw new Error("Must specify URL, WebSocket or RTCDataChannel");
|
||||||
|
|
@ -2508,6 +2508,7 @@ export default class RFB extends EventTargetMixin {
|
||||||
this._socketError(
|
this._socketError(
|
||||||
"Keepalive timeout: No keepalive update received in the last 10 seconds."
|
"Keepalive timeout: No keepalive update received in the last 10 seconds."
|
||||||
);
|
);
|
||||||
|
this.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to reset the keepalive timer
|
// Function to reset the keepalive timer
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue