Split cleanup from closing the socket
This commit is contained in:
parent
3bb12056b1
commit
6c14514774
10
core/rfb.js
10
core/rfb.js
|
@ -246,7 +246,7 @@
|
|||
});
|
||||
|
||||
this._init_vars();
|
||||
this._cleanupSocket();
|
||||
this._cleanup();
|
||||
|
||||
var rmode = this._display.get_render_mode();
|
||||
Util.Info("Using native WebSockets, render mode: " + rmode);
|
||||
|
@ -408,7 +408,7 @@
|
|||
}
|
||||
},
|
||||
|
||||
_cleanupSocket: function () {
|
||||
_cleanup: function () {
|
||||
if (this._msgTimer) {
|
||||
clearInterval(this._msgTimer);
|
||||
this._msgTimer = null;
|
||||
|
@ -424,8 +424,6 @@
|
|||
this._display.clear();
|
||||
}
|
||||
}
|
||||
|
||||
this._sock.close();
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -494,8 +492,8 @@
|
|||
break;
|
||||
|
||||
case 'disconnecting':
|
||||
// WebSocket.onclose transitions to 'disconnected'
|
||||
this._cleanupSocket();
|
||||
this._cleanup();
|
||||
this._sock.close(); // transitions to 'disconnected'
|
||||
|
||||
this._disconnTimer = setTimeout(function () {
|
||||
this._rfb_disconnect_reason = "Disconnect timeout";
|
||||
|
|
Loading…
Reference in New Issue