From 9f909d9b460675cc80624f5aeb018f46c3f41fae Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Tue, 8 Nov 2016 18:18:19 +0100 Subject: [PATCH] Don't wait for websocket closes on failure RFB._fail() can be called at any time in any state, it is not certain that we will get a close event on the socket since the socket might not be open. This caused us to hit the disconnect timeout in such cases. Fixes issue #678 --- core/rfb.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/rfb.js b/core/rfb.js index 91d9a6ff..8e9c5700 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -572,7 +572,11 @@ break; } this._rfb_disconnect_reason = msg; + + // Transition to disconnected without waiting for socket to close this._updateConnectionState('disconnecting'); + this._updateConnectionState('disconnected'); + return false; },