net: improve disconnect/reconnect messaging and use 5s retry cadence
This commit is contained in:
@@ -63,7 +63,8 @@ This is a behavior guide for packet semantics beyond raw schemas.
|
||||
- Heartbeat pings use negative `clientSentAt` ids and are internal (not user-visible ping status).
|
||||
- If websocket close is observed unexpectedly, client starts reconnect flow.
|
||||
- If a heartbeat `pong` is missed for one interval (10 seconds), client also starts reconnect flow.
|
||||
- Reconnect flow waits 2 seconds and retries up to 3 times before stopping.
|
||||
- Reconnect flow waits 5 seconds and retries up to 3 times before stopping.
|
||||
- After reconnect, if `welcome.serverInfo.instanceId` changed, client announces `Server restarted.`
|
||||
- Client emits `Connected. Version <version>.` after each `welcome`.
|
||||
- Client emits `Connected to server. Version <version>.` on initial `welcome` and
|
||||
`Reconnected to server. Version <version>.` after reconnect.
|
||||
- If `welcome.serverInfo.version` differs from running client version, client auto-reloads.
|
||||
|
||||
@@ -50,7 +50,7 @@ Core incoming message effects:
|
||||
- If websocket closes unexpectedly, client starts reconnect flow immediately.
|
||||
- While running, client also sends heartbeat `ping` every 10 seconds (fallback for silent half-open cases).
|
||||
- If one heartbeat `pong` is missed (10-second interval), client starts reconnect flow.
|
||||
- Reconnect flow waits 2 seconds and retries up to 3 times.
|
||||
- Reconnect flow waits 5 seconds and retries up to 3 times.
|
||||
- If reconnect lands on a different `welcome.serverInfo.instanceId`, client announces server restart.
|
||||
- Connect/reconnect status message is emitted from `welcome` and includes server version.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user