MCPcopy
hub / github.com/novnc/noVNC / _normalMsg

Method _normalMsg

core/rfb.js:2559–2615  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2557 }
2558
2559 _normalMsg() {
2560 let msgType;
2561 if (this._FBU.rects > 0) {
2562 msgType = 0;
2563 } else {
2564 msgType = this._sock.rQshift8();
2565 }
2566
2567 let first, ret;
2568 switch (msgType) {
2569 case 0: // FramebufferUpdate
2570 ret = this._framebufferUpdate();
2571 if (ret && !this._enabledContinuousUpdates) {
2572 RFB.messages.fbUpdateRequest(this._sock, true, 0, 0,
2573 this._fbWidth, this._fbHeight);
2574 }
2575 return ret;
2576
2577 case 1: // SetColorMapEntries
2578 return this._handleSetColourMapMsg();
2579
2580 case 2: // Bell
2581 Log.Debug("Bell");
2582 this.dispatchEvent(new CustomEvent(
2583 "bell",
2584 { detail: {} }));
2585 return true;
2586
2587 case 3: // ServerCutText
2588 return this._handleServerCutText();
2589
2590 case 150: // EndOfContinuousUpdates
2591 first = !this._supportsContinuousUpdates;
2592 this._supportsContinuousUpdates = true;
2593 this._enabledContinuousUpdates = false;
2594 if (first) {
2595 this._enabledContinuousUpdates = true;
2596 this._updateContinuousUpdates();
2597 Log.Info("Enabling continuous updates.");
2598 } else {
2599 // FIXME: We need to send a framebufferupdaterequest here
2600 // if we add support for turning off continuous updates
2601 }
2602 return true;
2603
2604 case 248: // ServerFence
2605 return this._handleServerFenceMsg();
2606
2607 case 250: // XVP
2608 return this._handleXvpMsg();
2609
2610 default:
2611 this._fail("Unexpected server message (type " + msgType + ")");
2612 Log.Debug("sock.rQpeekBytes(30): " + this._sock.rQpeekBytes(30));
2613 return true;
2614 }
2615 }
2616

Callers 1

_handleMessageMethod · 0.95

Calls 10

_framebufferUpdateMethod · 0.95
_handleServerCutTextMethod · 0.95
_handleServerFenceMsgMethod · 0.95
_handleXvpMsgMethod · 0.95
_failMethod · 0.95
rQshift8Method · 0.80
dispatchEventMethod · 0.80
rQpeekBytesMethod · 0.80

Tested by

no test coverage detected