Strophe.js
    Preparing search index...

    Class default

    Private helper class that handles BOSH Connections The Bosh class is used internally by Connection to encapsulate BOSH sessions. It is not meant to be used from user's code.

    Implements

    Index
    _conn: any

    The Connection that owns this transport.

    _requests: Request[]
    errors: number
    hold: number
    inactivity: number
    lastResponseHeaders: string
    rid: number
    sid: string
    strip: boolean

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

    wait: number
    window: number
    • Attach to an already created and authenticated BOSH session.

      This function is provided to allow Strophe to attach to BOSH sessions which have been created externally, perhaps by a Web application. This is often used to support auto-login type features without putting user credentials into the page.

      Parameters

      • jid: string

        The full JID that is bound by the session.

      • sid: string

        The SID of the BOSH session.

      • rid: number

        The current RID of the BOSH session. This RID will be used by the next request.

      • callback: Function

        The connect callback function.

      • wait: number

        The optional HTTPBIND wait value. This is the time the server will wait before returning an empty result for a request. The default setting of 60 seconds is recommended. Other settings will require tweaks to the Strophe.TIMEOUT value.

      • hold: number

        The optional HTTPBIND hold value. This is the number of connections the server will hold at one time. This should almost always be set to 1 (the default).

      • wind: number

        The optional HTTBIND window value. This is the allowed range of request ids that are valid. The default is 5.

      Returns void

    • Private function that initializes the BOSH connection. Creates and sends the Request that initializes the BOSH connection.

      Parameters

      • wait: number

        The optional HTTPBIND wait value. This is the time the server will wait before returning an empty result for a request. The default setting of 60 seconds is recommended. Other settings will require tweaks to the Strophe.TIMEOUT value.

      • hold: number

        The optional HTTPBIND hold value. This is the number of connections the server will hold at one time. This should almost always be set to 1 (the default).

      • route: string

      Returns void

    • Private handler for initial connection request. This handler is used to process the Bosh-part of the initial request.

      Parameters

      • bodyWrap: Element

        The received stanza.

      Returns number

    • Called on stream start/restart when no stream:features has been received and sends a blank poll request.

      Parameters

      • Optionalcallback: ConnectionCallback

      Returns void

    • Private handler called by Connection#_onIdle|Connection._onIdle(). Sends all queued Requests or polls with empty Request if there are none.

      Returns void

    • Private function to get a stanza out of a request. Tries to extract a stanza out of a Request Object. When this fails the current connection will be disconnected.

      Parameters

      Returns Element

      The stanza that was passed.

    • Attempt to restore a cached BOSH session

      Parameters

      • jid: string

        The full JID that is bound by the session. This parameter is optional but recommended, specifically in cases where prebinded BOSH sessions are used where it's important to know that the right session is being restored.

      • callback: Function

        The connect callback function.

      • wait: number

        The optional HTTPBIND wait value. This is the time the server will wait before returning an empty result for a request. The default setting of 60 seconds is recommended. Other settings will require tweaks to the Strophe.TIMEOUT value.

      • hold: number

        The optional HTTPBIND hold value. This is the number of connections the server will hold at one time. This should almost always be set to 1 (the default).

      • wind: number

        The optional HTTBIND window value. This is the allowed range of request ids that are valid. The default is 5.

      Returns void

    • Private part of the Connection.send function for BOSH Just triggers the RequestHandler to send the messages that are in the queue

      Returns void