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

Method _handleMessage

core/rfb.js:985–1019  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

983 }
984
985 _handleMessage() {
986 if (this._sock.rQwait("message", 1)) {
987 Log.Warn("handleMessage called on an empty receive queue");
988 return;
989 }
990
991 switch (this._rfbConnectionState) {
992 case 'disconnected':
993 Log.Error("Got data while disconnected");
994 break;
995 case 'connected':
996 while (true) {
997 if (this._flushing) {
998 break;
999 }
1000 if (!this._normalMsg()) {
1001 break;
1002 }
1003 if (this._sock.rQwait("message", 1)) {
1004 break;
1005 }
1006 }
1007 break;
1008 case 'connecting':
1009 while (this._rfbConnectionState === 'connecting') {
1010 if (!this._initMsg()) {
1011 break;
1012 }
1013 }
1014 break;
1015 default:
1016 Log.Error("Got data while in an invalid state");
1017 break;
1018 }
1019 }
1020
1021 _handleKeyEvent(keysym, code, down, numlock, capslock) {
1022 // If remote state of capslock is known, and it doesn't match the local led state of

Callers 1

_framebufferUpdateMethod · 0.95

Calls 3

_normalMsgMethod · 0.95
_initMsgMethod · 0.95
rQwaitMethod · 0.80

Tested by

no test coverage detected