MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / close

Method close

src/plugins/websocket/www/websocket.js:130–133  ·  view source on GitHub ↗

* Closes the WebSocket connection. * * @param {number} code The status code explaining why the connection is being closed. * @param {string} reason A human-readable string explaining why the connection is being closed.

(code, reason)

Source from the content-addressed store, hash-verified

128 * @param {string} reason A human-readable string explaining why the connection is being closed.
129 */
130 close(code, reason) {
131 this.readyState = WebSocketInstance.CLOSING;
132 exec(() => logIfDebug(`[Cordova WebSocket - ID=${this.instanceId}] Close requested`, code, reason), (err) => console.error(`[Cordova WebSocket - ID=${this.instanceId}] Close error`, err), "WebSocketPlugin", "close", [this.instanceId, code, reason]);
133 }
134}
135
136WebSocketInstance.CONNECTING = 0;

Callers

nothing calls this directly

Calls 3

logIfDebugFunction · 0.85
execFunction · 0.50
errorMethod · 0.45

Tested by

no test coverage detected