diff options
author | Samuel Mannehed <samuel@cendio.se> | 2016-11-08 16:27:31 +0100 |
---|---|---|
committer | Samuel Mannehed <samuel@cendio.se> | 2016-11-10 14:33:29 +0100 |
commit | e48d1b254ea14a3679fc40e241cf80176343fca1 (patch) | |
tree | bb1ae5b219262d78846c1f81195ddcc63678e4ae | |
parent | c4b274ebb8cf7d6870db96cd9efdd6ebeee5b02a (diff) | |
download | novnc-e48d1b254ea14a3679fc40e241cf80176343fca1.tar.gz |
Separate state actions from connection actions
-rw-r--r-- | core/rfb.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/rfb.js b/core/rfb.js index e253f0b..d83b691 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -361,6 +361,7 @@ _connect: function () { Util.Debug(">> RFB.connect"); + this._init_vars(); var uri; if (typeof UsingSocketIO !== 'undefined') { @@ -373,6 +374,7 @@ Util.Info("connecting to " + uri); try { + // WebSocket.onopen transitions to the RFB init states this._sock.open(uri, this._wsProtocols); } catch (e) { if (e.name === 'SyntaxError') { @@ -504,9 +506,6 @@ break; case 'connecting': - this._init_vars(); - - // WebSocket.onopen transitions to the RFB init states this._connect(); break; |