Networking · interface

WebSocketTransportOptions

Explained in Networking and rollback.

interface WebSocketTransportOptions
import type { WebSocketTransportOptions } from '@driftengine/network';

Properties

NameTypeDescription
socketreadonlySocketLike
selfreadonlyoptionalPeerIdThis end's id, or -1 to wait for a host to assign one through a welcome.
maxQueuedreadonlyoptionalnumberHow many messages may queue before the oldest is dropped.
More

A bound rather than none, because a socket that stops draining is a socket behind a paused tab or a stalled link, and an unbounded queue there is a leak that ends the session with a crash instead of a disconnection. The oldest goes, because in a simulation the newest input is the one still worth having.