async stop() {
        // Capture the start promise before the connection might be restarted in an onclose callback.
        const startPromise = this._startPromise;
        this._stopPromise = this._stopInternal();
        await this._stopPromise;
        try {
            // Awaiting undefined continues immediately
            await startPromise;
        }
        catch (e) {
            // This exception is returned to the user as a rejected Promise from the start method.
        }
    }
/** Stops the connection.
     *
     * @returns {Promise<void>} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.
     */
Stops the connection.
@returns {Promise} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.
Stops the connection . @returns { Promise } A Promise that resolves when the connection has been successfully terminated or rejects with an error .
async stop() {
        const startPromise = this._startPromise;
        this._stopPromise = this._stopInternal();
        await this._stopPromise;
        try {
            await startPromise;
        }
        catch (e) {
        }
    }
async stop ( ) { const startPromise = this . _startPromise ; this . _stopPromise = this . _stopInternal ( ) ; await this . _stopPromise ; try { await startPromise ; } catch ( e ) { } }
Stops the connection.
Stops the connection .
// Capture the start promise before the connection might be restarted in an onclose callback. // Awaiting undefined continues immediately // This exception is returned to the user as a rejected Promise from the start method.