protected void ShutdownMiner(bool withCrtlC = false) { if (IsRunning) { Helpers.ConsolePrint(MinerTag(), ProcessTag() + " Shutting down miner"); } if (ProcessHandle != null) { try { if (withCrtlC) { ProcessHandle.SendCtrlC((uint)Process.GetCurrentProcess().Id); } else { ProcessHandle.Kill(); } } catch { } ProcessHandle.Close(); ProcessHandle = null; // sgminer needs to be removed and kill by PID if (IsKillAllUsedMinerProcs) { KillAllUsedMinerProcesses(); } } }
protected void Stop_cpu_ccminer_sgminer_nheqminer(MinerStopType willswitch) { if (IsRunning) { Helpers.ConsolePrint(MinerTAG(), ProcessTag() + " Shutting down miner"); } if (ProcessHandle != null) { //try { ProcessHandle.Kill(); } catch { } try { ProcessHandle.SendCtrlC((uint)Process.GetCurrentProcess().Id); } catch { } ProcessHandle.Close(); ProcessHandle = null; // sgminer needs to be removed and kill by PID //if (IsKillAllUsedMinerProcs) KillAllUsedMinerProcesses(); } }