mirror of
https://github.com/novnc/noVNC.git
synced 2026-05-30 00:49:38 +00:00
Separate state actions from connection actions
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user