Field Notes
    Preparing search index...

    Interface Connection

    interface Connection {
        authContext?: Readonly<Record<string, AuthContextValue>>;
        expiresAt?: number;
        id: string;
        role?: string;
        room: string;
        signal?: AbortSignal;
        userId?: string;
        close?(code: 1013 | 4401 | 4403 | 4406 | 4408): void;
        send(message: string): void;
        sendAsync?(message: string): Promise<void>;
    }
    Index
    authContext?: Readonly<Record<string, AuthContextValue>>
    expiresAt?: number
    id: string
    role?: string
    room: string
    signal?: AbortSignal

    Factory-owned lifetime and close hooks required for isolated authority connections.

    userId?: string
    • Parameters

      • code: 1013 | 4401 | 4403 | 4406 | 4408

      Returns void

    • Optional on guarded connections and custom adapters. Resolves after a local socket-write callback, not peer receipt or durable commit. Callers must await/catch rejection; a failed caller may leave active native work occupying bounded transport capacity until it settles.

      Parameters

      • message: string

      Returns Promise<void>