mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
Added "heartbeat" for update throttling.
This commit is contained in:
@@ -540,7 +540,27 @@ function VNCClient(display) {
|
||||
handler(parameters);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sendReady() {
|
||||
|
||||
// Start heartbeat signal
|
||||
var heartbeat = new XMLHttpRequest();
|
||||
heartbeat.open("GET", "ready");
|
||||
|
||||
heartbeat.onreadystatechange = function() {
|
||||
|
||||
if (heartbeat != null && heartbeat.readyState >= 2) {
|
||||
heartbeat = null;
|
||||
setTimeout(sendReady, 50);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
heartbeat.send();
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.connect = function() {
|
||||
|
||||
@@ -555,6 +575,7 @@ function VNCClient(display) {
|
||||
var message = new GuacamoleMessage(connect_xmlhttprequest.responseXML);
|
||||
if (!message.hasErrors()) {
|
||||
setState(STATE_WAITING);
|
||||
sendReady();
|
||||
handleResponse(makeRequest()); // Start stream if connection successful
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user