예제 #1
0
        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();
                }
            }
        }
예제 #2
0
        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();
            }
        }