/// <summary> /// Creates a server process based on the supplied configuration data, and adds /// it to the Process Manager. /// </summary> /// <param name="processConfig">A valid ProcessConfigurationData object.</param> /// <returns>The process's unique identifier.</returns> public static int CreateProcess(ProcessConfigurationData processConfig) { ServerProcess proc = new ServerProcess(processConfig); proc.StartProcess(); processes.Add(proc); return(proc.Identifier); }
private void Process_ProcessCrash(object sender, EventArgs e) { CrashReport report = new CrashReport(this.process); reports.Add(report); // Determine the stability of the process and if we should restart it. if (Stable) { Trace.WriteLine("ServerProcessWatchdog has determined that the process is stable, and is attempting to restart it."); process.StartProcess(); } else { Trace.WriteLine("ServerProcessWatchdog has declared the process to be unstable, and will no longer monitor or attempt to start it until manual intervention takes place."); if (ProcessUnstable != null) { ProcessUnstable(this, new EventArgs()); } } }