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
This commit is contained in:
Samuel Mannehed 2016-11-08 18:18:19 +01:00
parent b2e961d48d
commit 9f909d9b46
1 changed files with 4 additions and 0 deletions

View File

@ -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;
},