Brunet.Applications.BasicNode.OnExit C# (CSharp) Method

OnExit() public method

This method is registered as a delegate to Shutdown.OnExit and will be called when ctrl-c is pressed by the user. This stops services, prevents the node from reincarnating, and then disconnects the node.
public OnExit ( ) : void
return void
    public virtual void OnExit() {
      _running = false;

      if(_xrm != null) {
        _xrm.Stop();
        _xrm = null;
      }

      ApplicationNode appnode = _app_node;
      _app_node = null;

      NCService ncservice = null;
      if(appnode != null) {
        ncservice = appnode.NCService;
      }

      if(ncservice != null && _node_config.NCService.Checkpointing) {
        string checkpoint = ncservice.GetCheckpoint();
        string prev_cp = _node_config.NCService.Checkpoint;
        string empty_cp = (new Point()).ToString();
        if(!checkpoint.Equals(prev_cp) && !checkpoint.Equals(empty_cp))
        {
          _node_config.NCService.Checkpoint = checkpoint;
          _node_config.WriteConfig();
        }
      }

      _fe_stop_pem = Brunet.Util.FuzzyTimer.Instance.DoEvery(StopPem, 500, 500);
    }
  }