docs: function (reason)
      {
          this._changeConnectStatus(Strophe.Status.DISCONNECTING, reason);
  
          Strophe.info("Disconnect was called because: " + reason);
          if (this.connected) {
              var pres = false;
              this.disconnecting = true;
              if (this.authenticated) {
                  pres = $pres({
                      xmlns: Strophe.NS.CLIENT,
                      type: 'unavailable'
                  });
              }
              // setup timeout handler
              this._disconnectTimeout = this._addSysTimedHandler(
                  3000, this._onDisconnectTimeout.bind(this));
              this._proto._disconnect(pres);
          } else {
              Strophe.info("Disconnect was called before Strophe connected to the server");
              this._proto._abortAllRequests();
          }
      }