summaryrefslogtreecommitdiff
path: root/web/src/lib/protocol/connection.ts
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/lib/protocol/connection.ts')
-rw-r--r--web/src/lib/protocol/connection.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/src/lib/protocol/connection.ts b/web/src/lib/protocol/connection.ts
index a553481..cbf86f5 100644
--- a/web/src/lib/protocol/connection.ts
+++ b/web/src/lib/protocol/connection.ts
@@ -47,7 +47,8 @@ export interface Transport {
onmessage: ((ev: { data: unknown }) => void) | null;
send(data: string): void;
close(): void;
- readyState: number; // 0 OPEN
+ /** `WebSocket.OPEN` — 1. (0 is CONNECTING; 2 CLOSING; 3 CLOSED.) */
+ readyState: number;
}
export interface ConnectionOptions {
@@ -62,7 +63,8 @@ export interface ConnectionOptions {
pingIntervalMs?: number;
}
-const OPEN = 0;
+/** `WebSocket.OPEN` — the socket is connected and can carry frames. */
+const OPEN = 1;
export class GameConnection {
status: ConnectionStatus = 'connecting';