@tikoci/centrs
    Preparing search index...

    Interface BtestUdpSocket

    Datagram socket seam for the UDP data path.

    interface BtestUdpSocket {
        bind(port: number, host: string): Promise<number>;
        close(): void;
        connect(port: number, host: string): Promise<void>;
        onMessage(handler: (bytes: Uint8Array) => void): void;
        send(bytes: Uint8Array, port?: number, host?: string): void;
    }
    Index
    • Bind to host:port; resolves with the actually-bound port.

      Parameters

      • port: number
      • host: string

      Returns Promise<number>

    • Pin the default destination (so send needs no address).

      Parameters

      • port: number
      • host: string

      Returns Promise<void>

    • Register the inbound-datagram handler.

      Parameters

      • handler: (bytes: Uint8Array) => void

      Returns void

    • Send a datagram; port/host override the connected default.

      Parameters

      • bytes: Uint8Array
      • Optionalport: number
      • Optionalhost: string

      Returns void