lib/js/Server.js
function(callback) {
      var t = this, server = t.get('server');
      callback = callback || function(){};

      // Unwatch all template files
      t.get('templates').forEach(function(template) {
        template.unWatchFile();
      });

      // Don't stop more than once.
      if (!t.isListening) {
        return callback();
      }

      // Shut down the server
      t.isListening = false;
      t.monitorServer.stop(function(error) {
        if (!error) {
          // Disregard close exception
          try {
            server.close();
          } catch (e) {}
          t.trigger('stop');
        }
        return callback(error);
      });
    }
function(callback) {
      var t = this, server = t.get('server');
      callback = callback || function(){};

      // Unwatch all template files
      t.get('templates').forEach(function(template) {
        template.unWatchFile();
      });

      // Don't stop more than once.
      if (!t.isListening) {
        return callback();
      }

      // Shut down the server
      t.isListening = false;
      t.monitorServer.stop(function(error) {
        if (!error) {
          // Disregard close exception
          try {
            server.close();
          } catch (e) {}
          t.trigger('stop');
        }
        return callback(error);
      });
    }
function ( callback ) { var t = this , server = t . get ( 'server' ) ; callback = callback || function ( ) { } ; // Unwatch all template files t . get ( 'templates' ) . forEach ( function ( template ) { template . unWatchFile ( ) ; } ) ; // Don't stop more than once. if ( ! t . isListening ) { return callback ( ) ; } // Shut down the server t . isListening = false ; t . monitorServer . stop ( function ( error ) { if ( ! error ) { // Disregard close exception try { server . close ( ) ; } catch ( e ) { } t . trigger ( 'stop' ) ; } return callback ( error ) ; } ) ; }
Stop processing inbound web and monitor traffic

This method stops accepting new inbound monitor connections, and closes
all existing monitor connections associated with the server.

@method stop
@param callback {Function(error)} - Called when the server has stopped
 
The server has stopped

This event is fired after the server has stopped accepting inbound
connections, and has closed all existing connections and released
associated resources.

@event stop
Stop processing inbound web and monitor traffic