Core
SocketLifecycleOutcome
The outcome of a single connect attempt, not the final result of the session.
@defjs/core · Type
Signature
type SocketLifecycleOutcome = { closeInfo: WebSocketCloseSnapshot; connection?: WebSocketConnectionInfo; cause?: unknown; opened: boolean; };
The reconnect logic uses it to decide whether to try again.
-
closeInfoholds the close details of that attempt:{ cause?, code?, reason?, wasClean? }. -
connectionis the connection snapshot, when the attempt got one. -
causeis the error that ended the attempt, if any. -
openedtells whether the socket reachedopenbefore it ended.
The shouldReconnect option does not receive this object. It gets attempt, cause, code, reason, and wasClean, taken from it. The final result of the session is WebSocketCloseInfo.
Members
Prop
Type
closeInfo WebSocketCloseSnapshotconnection? WebSocketConnectionInfo | undefinedcause? unknownopened boolean