console proxy client sleep more generic (#8694)

* Make wait in the noVNC console proxy client more generic

* Update services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyNoVncClient.java

Co-authored-by: Wei Zhou <weizhou@apache.org>

---------

Co-authored-by: Wei Zhou <weizhou@apache.org>
This commit is contained in:
dahn 2024-02-27 07:24:05 +01:00 committed by GitHub
parent bbe56ae283
commit 4e34e6b334
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -114,11 +114,6 @@ public class ConsoleProxyNoVncClient implements ConsoleProxyClient {
updateFrontEndActivityTime(); updateFrontEndActivityTime();
} }
connectionAlive = session.isOpen(); connectionAlive = session.isOpen();
try {
Thread.sleep(1);
} catch (InterruptedException e) {
s_logger.error("Error on sleep for vnc over websocket", e);
}
} else if (client.isVncOverNioSocket()) { } else if (client.isVncOverNioSocket()) {
byte[] bytesArr; byte[] bytesArr;
int nextBytes = client.getNextBytes(); int nextBytes = client.getNextBytes();
@ -139,6 +134,11 @@ public class ConsoleProxyNoVncClient implements ConsoleProxyClient {
connectionAlive = false; connectionAlive = false;
} }
} }
try {
Thread.sleep(1);
} catch (InterruptedException e) {
s_logger.error("Error on sleep for vnc sessions", e);
}
} }
s_logger.info(String.format("Connection with client [%s] is dead.", clientId)); s_logger.info(String.format("Connection with client [%s] is dead.", clientId));
} catch (IOException e) { } catch (IOException e) {