Skip to content

1681-engine / index / shouldReconnect

Function: shouldReconnect() ​

ts
function shouldReconnect(code, o): boolean;

Defined in: src/net/reconnect.ts:13

Whether a socket that closed with code should reconnect by itself: not when we closed it, not when reconnecting is off, and not on a code the server uses to say "do not come back" (kicked, banned, an outdated client) — retrying those only loops.

Parameters ​

ParameterType
codenumber
o{ closedByUs: boolean; fatalCloseCodes?: readonly number[]; reconnect?: boolean; }
o.closedByUsboolean
o.fatalCloseCodes?readonly number[]
o.reconnect?boolean

Returns ​

boolean

Released under the MIT License.