Function: safeTerminateWs()
ts
function safeTerminateWs(ws?: any, fallbackToClose?: boolean): boolean;Call terminate() when the socket provides it. Otherwise, call close() only when fallbackToClose is true, including in browsers. Returns true only when terminate() was called; returns false for the fallback or a missing socket.
Parameters
| Parameter | Type |
|---|---|
ws? | any |
fallbackToClose? | boolean |
Returns
boolean