Add getters/setter to websock

This commit is contained in:
Juanjo Diaz
2018-12-08 17:31:20 +02:00
parent 18439b0680
commit 8a189a6291
7 changed files with 72 additions and 84 deletions

View File

@@ -681,7 +681,7 @@ export default class RFB extends EventTargetMixin {
}
_handle_message() {
if (this._sock.rQlen() === 0) {
if (this._sock.rQlen === 0) {
Log.Warn("handle_message called on an empty receive queue");
return;
}
@@ -698,7 +698,7 @@ export default class RFB extends EventTargetMixin {
if (!this._normal_msg()) {
break;
}
if (this._sock.rQlen() === 0) {
if (this._sock.rQlen === 0) {
break;
}
}
@@ -779,7 +779,7 @@ export default class RFB extends EventTargetMixin {
// Message Handlers
_negotiate_protocol_version() {
if (this._sock.rQlen() < 12) {
if (this._sock.rQlen < 12) {
return this._fail("Received incomplete protocol version.");
}
@@ -1360,7 +1360,7 @@ export default class RFB extends EventTargetMixin {
_handle_xvp_msg() {
if (this._sock.rQwait("XVP version and message", 3, 1)) { return false; }
this._sock.rQskip8(); // Padding
this._sock.rQskipBytes(1); // Padding
const xvp_ver = this._sock.rQshift8();
const xvp_msg = this._sock.rQshift8();
@@ -1442,7 +1442,7 @@ export default class RFB extends EventTargetMixin {
_onFlush() {
this._flushing = false;
// Resume processing
if (this._sock.rQlen() > 0) {
if (this._sock.rQlen > 0) {
this._handle_message();
}
}
@@ -1450,7 +1450,7 @@ export default class RFB extends EventTargetMixin {
_framebufferUpdate() {
if (this._FBU.rects === 0) {
if (this._sock.rQwait("FBU header", 3, 1)) { return false; }
this._sock.rQskip8(); // Padding
this._sock.rQskipBytes(1); // Padding
this._FBU.rects = this._sock.rQshift16();
// Make sure the previous frame is fully rendered first