B2G/gecko/services/common/modules-testing/storageserver.js
/**
   * Start the StorageServer's underlying HTTP server.
   *
   * @param port
   *        The numeric port on which to start. A falsy value implies the
   *        default (8080).
   * @param cb
   *        A callback function (of no arguments) which is invoked after
   *        startup.
   */
Start the StorageServer's underlying HTTP server.
@param port
The numeric port on which to start. A falsy value implies the
default (8080).
@param cb
A callback function (of no arguments) which is invoked after
startup.
Start the StorageServer ' s underlying HTTP server . @param port The numeric port on which to start . A falsy value implies the default ( 8080 ) . @param cb A callback function ( of no arguments ) which is invoked after startup .
function start(port, cb) {
    if (this.started) {
      this._log.warn("Warning: server already started on " + this.port);
      return;
    }
    if (port) {
      this.port = port;
    }
    try {
      this.server.start(this.port);
      this.started = true;
      if (cb) {
        cb();
      }
    } catch (ex) {
      _("==========================================");
      _("Got exception starting Storage HTTP server on port " + this.port);
      _("Error: " + CommonUtils.exceptionStr(ex));
      _("Is there a process already listening on port " + this.port + "?");
      _("==========================================");
      do_throw(ex);
    }
  }
function start ( port , cb ) { if ( this . started ) { this . _log . warn ( "Warning: server already started on " + this . port ) ; return ; } if ( port ) { this . port = port ; } try { this . server . start ( this . port ) ; this . started = true ; if ( cb ) { cb ( ) ; } } catch ( ex ) { _ ( "==========================================" ) ; _ ( "Got exception starting Storage HTTP server on port " + this . port ) ; _ ( "Error: " + CommonUtils . exceptionStr ( ex ) ) ; _ ( "Is there a process already listening on port " + this . port + "?" ) ; _ ( "==========================================" ) ; do_throw ( ex ) ; } }
Start the StorageServer's underlying HTTP server.
Start the StorageServer ' s underlying HTTP server .