Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / MatchSessionReconnectState

Type Alias: MatchSessionReconnectState ​

MatchSessionReconnectState = { phase: "idle"; } | { attempt: number; delayMs: number; maxAttempts: number; phase: "waiting"; } | { attempt: number; maxAttempts: number; phase: "connecting"; } | { attempts: number; cause: MatchSessionTerminalCause; error: ErrorPayload; maxAttempts: number; phase: "terminal"; }

Defined in: packages/ts-sdk/src/match-session/session-state.ts:150

Progress of automatic recovery after an abnormal match socket close.

Example:

ts
import type { MatchSessionReconnectState } from '@my-swu/simulator-client'

// 'idle' means no reconnect is in flight; retries report attempt counts.
const matchSessionReconnectState: MatchSessionReconnectState = { phase: 'idle' }

console.log(matchSessionReconnectState)

Released under the MIT License.