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

Method _socketClose

systemvm/agent/noVNC/core/rfb.js:809–844  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

807 }
808
809 _socketClose(e) {
810 Log.Debug("WebSocket on-close event");
811 let msg = "";
812 if (e.code) {
813 msg = "(code: " + e.code;
814 if (e.reason) {
815 msg += ", reason: " + e.reason;
816 }
817 msg += ")";
818 }
819 switch (this._rfbConnectionState) {
820 case 'connecting':
821 this._fail("Connection closed " + msg);
822 break;
823 case 'connected':
824 // Handle disconnects that were initiated server-side
825 this._updateConnectionState('disconnecting');
826 this._updateConnectionState('disconnected');
827 break;
828 case 'disconnecting':
829 // Normal disconnection path
830 this._updateConnectionState('disconnected');
831 break;
832 case 'disconnected':
833 this._fail("Unexpected server disconnect " +
834 "when already disconnected " + msg);
835 break;
836 default:
837 this._fail("Unexpected server disconnect before connecting " +
838 msg);
839 break;
840 }
841 this._sock.off('close');
842 // Delete reference to raw channel to allow cleanup.
843 this._rawChannel = null;
844 }
845
846 _socketError(e) {
847 Log.Warn("WebSocket on-error event");

Callers

nothing calls this directly

Calls 3

_failMethod · 0.95
offMethod · 0.80

Tested by

no test coverage detected