* 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)
| 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 | |
| 136 | WebSocketInstance.CONNECTING = 0; |
nothing calls this directly
no test coverage detected