xmpp-httpx - v0.11.0
    Preparing search index...

    Interface IbbDuplex

    One IBB session used in both directions: readable is what the peer sends, write() is what we send, on the same sid with independent seq counters.

    There is no half-close. close() and abort() end both directions, and so does the peer's : readable then ends cleanly and later writes reject. Cancelling readable is an abort — a tunnel whose reader has gone has nobody left to read the answer.

    interface IbbDuplex {
        blockSize: number;
        peer: string;
        readable: ReadableStream<Uint8Array<ArrayBufferLike>>;
        sid: string;
        abort(reason: Error): Promise<void>;
        close(): Promise<void>;
        write(bytes: Uint8Array): Promise<void>;
    }

    Hierarchy (View Summary)

    Index
    blockSize: number
    peer: string

    The peer's full JID.

    readable: ReadableStream<Uint8Array<ArrayBufferLike>>
    sid: string
    • Best-effort without flushing; the local error is remembered.

      Parameters

      • reason: Error

      Returns Promise<void>

    • Flushes any buffered partial block, waits for every outstanding block to be acknowledged, and sends . Rejects with the stream's failure if any block failed — so a caller that awaits close() has the same end-to-end guarantee it had when every write awaited its own ack.

      Returns Promise<void>

    • Hands the bytes over: a sub-block remainder stays buffered by reference until a later write or close() sends it, so the caller must not mutate the array after this resolves (the same contract as a WHATWG or Node stream sink — reusing a scratch buffer between writes corrupts the tail).

      Resolves once every full block it produced has been sent, not acked: with a window > 1 those blocks are still outstanding. It still blocks while the window is full, so it remains the backpressure the callers' pump loops rely on — it just yields after window blocks instead of one. A block that fails later is reported by a subsequent write() or by close(), which waits for every outstanding ack.

      Parameters

      • bytes: Uint8Array

      Returns Promise<void>