lib/MasterProxyServer.js
/**
   * Binds the server's SIGINT listener, which gracefully stops the server on a single sigint, and kills it on two.
   * @return {MasterProxyServer} A self reference to the current MasterProxyServer.
   */
Binds the server's SIGINT listener, which gracefully stops the server on a single sigint, and kills it on two.
@return {MasterProxyServer} A self reference to the current MasterProxyServer.
Binds the server ' s SIGINT listener which gracefully stops the server on a single sigint and kills it on two . @return { MasterProxyServer } A self reference to the current MasterProxyServer .
bindSIGINT() {
    this[server].sigintHandler = () => {
      if (this[server].sigintSignalsReceived > 0) process.exit(0);
      process.stdout.write('\r');
      this[server].log.close('Server gracefully shutting down (^C again to exit immediately)...');
      this[server].sigintSignalsReceived++;
      setTimeout(() => this.stop(), 500);
    };
    process.on('SIGINT', this[server].sigintHandler);
    return this;
  }
bindSIGINT ( ) { this [ server ] . sigintHandler = ( ) => { if ( this [ server ] . sigintSignalsReceived > 0 ) process . exit ( 0 ) ; process . stdout . write ( '\r' ) ; this [ server ] . log . close ( 'Server gracefully shutting down (^C again to exit immediately)...' ) ; this [ server ] . sigintSignalsReceived ++ ; setTimeout ( ( ) => this . stop ( ) , 500 ) ; } ; process . on ( 'SIGINT' , this [ server ] . sigintHandler ) ; return this ; }
Binds the server's SIGINT listener, which gracefully stops the server on a single sigint, and kills it on two.
Binds the server ' s SIGINT listener which gracefully stops the server on a single sigint and kills it on two .