MCPcopy Create free account
hub / github.com/apache/cloudstack / _normalMsg

Method _normalMsg

systemvm/agent/noVNC/core/rfb.js:2718–2774  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2716 }
2717
2718 _normalMsg() {
2719 let msgType;
2720 if (this._FBU.rects > 0) {
2721 msgType = 0;
2722 } else {
2723 msgType = this._sock.rQshift8();
2724 }
2725
2726 let first, ret;
2727 switch (msgType) {
2728 case 0: // FramebufferUpdate
2729 ret = this._framebufferUpdate();
2730 if (ret && !this._enabledContinuousUpdates) {
2731 RFB.messages.fbUpdateRequest(this._sock, true, 0, 0,
2732 this._fbWidth, this._fbHeight);
2733 }
2734 return ret;
2735
2736 case 1: // SetColorMapEntries
2737 return this._handleSetColourMapMsg();
2738
2739 case 2: // Bell
2740 Log.Debug("Bell");
2741 this.dispatchEvent(new CustomEvent(
2742 "bell",
2743 { detail: {} }));
2744 return true;
2745
2746 case 3: // ServerCutText
2747 return this._handleServerCutText();
2748
2749 case 150: // EndOfContinuousUpdates
2750 first = !this._supportsContinuousUpdates;
2751 this._supportsContinuousUpdates = true;
2752 this._enabledContinuousUpdates = false;
2753 if (first) {
2754 this._enabledContinuousUpdates = true;
2755 this._updateContinuousUpdates();
2756 Log.Info("Enabling continuous updates.");
2757 } else {
2758 // FIXME: We need to send a framebufferupdaterequest here
2759 // if we add support for turning off continuous updates
2760 }
2761 return true;
2762
2763 case 248: // ServerFence
2764 return this._handleServerFenceMsg();
2765
2766 case 250: // XVP
2767 return this._handleXvpMsg();
2768
2769 default:
2770 this._fail("Unexpected server message (type " + msgType + ")");
2771 Log.Debug("sock.rQpeekBytes(30): " + this._sock.rQpeekBytes(30));
2772 return true;
2773 }
2774 }
2775

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