Strophe.js
    Preparing search index...

    Interface Transport

    The contract every transport (BOSH, WebSocket, the shared-worker WebSocket, the XEP-0114 component transport, and any transport registered via Connection.addProtocol) must fulfil for Connection to drive it.

    These members carry a leading underscore for historical reasons: the codebase predates # private fields and marks internals with _. Despite the naming they are not private, they are the cross-class API that Connection invokes on this._proto. Transport-specific extras (BOSH's _attach/_restore, the worker's Stream Management callbacks, and so on) are deliberately kept off this interface; Connection reaches those through instanceof narrowing.

    interface Transport {
        _conn: default;
        strip: string | boolean;
        _abortAllRequests(): void;
        _connect(wait?: number, hold?: number, route?: string): void;
        _connect_cb(bodyWrap: Element): number | void;
        _disconnect(pres?: Element | Builder): void;
        _doDisconnect(): void;
        _emptyQueue(): boolean;
        _no_auth_received(callback?: () => void): void;
        _onDisconnectTimeout(): void;
        _onIdle(): void;
        _reset(): void;
        _send(): void;
        _sendRestart(): void;
    }

    Implemented by

    Index
    _conn: default

    The Connection that owns this transport.

    strip: string | boolean

    The wrapper element name whose children Connection unwraps before dispatch. BOSH overloads it as a boolean toggle, hence the union.

    • Abort any in-flight requests (a no-op for the streaming transports).

      Returns void

    • Open the transport. The wait/hold/route arguments are meaningful only to BOSH; the streaming transports ignore them.

      Parameters

      • Optionalwait: number
      • Optionalhold: number
      • Optionalroute: string

      Returns void

    • Inspect the opening stream/body and optionally return a status.

      Parameters

      • bodyWrap: Element

      Returns number | void

    • Tear the transport down without any further stream traffic.

      Returns void

    • Handle a stream that offered no usable authentication mechanism.

      Parameters

      • Optionalcallback: () => void

      Returns void

    • Restart the stream (a no-op where the concept does not apply).

      Returns void