diff options
| author | Osmium Sorcerer <os@sof.beauty> | 2026-03-16 14:12:22 +0000 |
|---|---|---|
| committer | Osmium Sorcerer <os@sof.beauty> | 2026-04-18 16:52:22 +0000 |
| commit | 2ef41402209b82279656ae4b1affe6484be1ed77 (patch) | |
| tree | aba1f661a3400d1e2230c639af14fa20fb6bfecf /webAO/client/sender/index.ts | |
| parent | a7e664d5527dac59d722cdb48bfd8e3edf86645f (diff) | |
Remove CH-sending timer
CH is an application-level keepalive packet that clients periodically
send for two reasons:
1. It tells the server they're still connected, preventing timeouts.
2. By measuring latency between sending CH and receiving CHECK, a client
can display ping.
Keepalive is redundant because WebSocket can handle that via PING frames on a
transport layer. WebAO also completely ignores CHECK and sends CH every
five seconds, which is superfluous (AO2 Client sends it once every 45
seconds, in comparison).
Sending CH via `setInterval` was also problematic: browsers seem to
throttle it when the tab becomes inactive, preventing periodic pings and
leading to the server disconnecting inactive browser clients.
Diffstat (limited to 'webAO/client/sender/index.ts')
| -rw-r--r-- | webAO/client/sender/index.ts | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/webAO/client/sender/index.ts b/webAO/client/sender/index.ts index e218b6b..b9e2b4f 100644 --- a/webAO/client/sender/index.ts +++ b/webAO/client/sender/index.ts @@ -1,7 +1,6 @@ import { sendIC } from "./sendIC"; import { sendSelf } from "./sendSelf"; import { sendServer } from "./sendServer"; -import { sendCheck } from "./sendCheck"; import { sendHP } from "./sendHP"; import { sendOOC } from "./sendOOC"; import { sendCharacter } from "./sendCharacter"; @@ -43,7 +42,6 @@ export interface ISender { ) => void; sendSelf: (message: string) => void; sendServer: (message: string) => void; - sendCheck: () => void; sendHP: (side: number, hp: number) => void; sendOOC: (message: string) => void; sendCharacter: (character: number) => void; @@ -59,7 +57,6 @@ export const sender = { sendIC, sendSelf, sendServer, - sendCheck, sendHP, sendOOC, sendCharacter, |
