dist/client/lance-gg.js
/**
     * Closes the connection.
     *
     * @api private
     */
Closes the connection.
@api private
Closes the connection . @api private
close() {
      const self = this;
      if ("opening" === this.readyState || "open" === this.readyState) {
        this.readyState = "closing";
        if (this.writeBuffer.length) {
          this.once("drain", function() {
            if (this.upgrading) {
              waitForUpgrade();
            } else {
              close();
            }
          });
        } else if (this.upgrading) {
          waitForUpgrade();
        } else {
          close();
        }
      }
      function close() {
        self.onClose("forced close");
        debug$3("socket closing - telling transport to close");
        self.transport.close();
      }
      function cleanupAndClose() {
        self.removeListener("upgrade", cleanupAndClose);
        self.removeListener("upgradeError", cleanupAndClose);
        close();
      }
      function waitForUpgrade() {
        self.once("upgrade", cleanupAndClose);
        self.once("upgradeError", cleanupAndClose);
      }
      return this;
    }
close ( ) { const self = this ; if ( "opening" === this . readyState || "open" === this . readyState ) { this . readyState = "closing" ; if ( this . writeBuffer . length ) { this . once ( "drain" , function ( ) { if ( this . upgrading ) { waitForUpgrade ( ) ; } else { close ( ) ; } } ) ; } else if ( this . upgrading ) { waitForUpgrade ( ) ; } else { close ( ) ; } } function close ( ) { self . onClose ( "forced close" ) ; debug$3 ( "socket closing - telling transport to close" ) ; self . transport . close ( ) ; } function cleanupAndClose ( ) { self . removeListener ( "upgrade" , cleanupAndClose ) ; self . removeListener ( "upgradeError" , cleanupAndClose ) ; close ( ) ; } function waitForUpgrade ( ) { self . once ( "upgrade" , cleanupAndClose ) ; self . once ( "upgradeError" , cleanupAndClose ) ; } return this ; }
Closes the connection.
Closes the connection .
// wait for upgrade to finish since we can't send packets while pausing a transport