Function: safeTerminateWs()
ts
function safeTerminateWs(ws?: any, fallbackToClose?: boolean): boolean;Call terminate() when available. Otherwise call close() only when fallbackToClose is true. Returns true only when terminate() was called; returns false after fallback close or when no socket is provided.
Parameters
| Parameter | Type |
|---|---|
ws? | any |
fallbackToClose? | boolean |
Returns
boolean