Skip to content

PlatformSocket

Defined in: platform/types.ts:111

The platform-neutral socket surface (GameSocket / WeChatSocket / a Node ws wrapper all fit): multicast on(event, fn) → unsubscribe, queues sends until open, moves string|ArrayBuffer frames.

readonly delivery: "reliable-ordered"

Defined in: platform/types.ts:115

Every platform socket is a WebSocket (browser, wx.connectSocket, Node ws), so every one of them delivers in order and loses nothing — which is what lets a socket be handed straight to replication.


readyState: PlatformSocketReadyState

Defined in: platform/types.ts:116

close(code?, reason?): void

Defined in: platform/types.ts:123

number

string

void


connect(): void

Defined in: platform/types.ts:121

void


on<K>(event, handler): () => void

Defined in: platform/types.ts:117

K extends keyof PlatformSocketEvents

K

(…args) => void

() => void


send(data): void

Defined in: platform/types.ts:122

string | ArrayBuffer

void