NiceHashMiner.EthminerReader.Start C# (CSharp) Method

Start() public method

Start listening.
public Start ( ) : void
return void
        public void Start()
        {
            isRunning = true;
            speed = 0;
            DAGprogress = 0;
            lastActiveTime = DateTime.Now;
            ipep = new IPEndPoint(IPAddress.Loopback, bindPort);
            client = new UdpClient(ipep);
            workerTimer = new Timer();
            workerTimer.Tick += workerTimer_Tick;
            workerTimer.Interval = 50;
            workerTimer.Start();
        }

Usage Example

Esempio n. 1
0
        virtual protected NiceHashProcess _Start()
        {
            PreviousTotalMH = 0.0;
            if (LastCommandLine.Length == 0 || EnabledDeviceCount() == 0)
            {
                return(null);
            }

            Helpers.ConsolePrint(MinerDeviceName, "Starting miner: " + LastCommandLine);

            NiceHashProcess P = new NiceHashProcess();

            if (WorkingDirectory.Length > 1)
            {
                P.StartInfo.WorkingDirectory = WorkingDirectory;
            }

            NumRetries = Config.ConfigData.MinerAPIGraceMinutes * 60 / Config.ConfigData.MinerAPIQueryInterval;
            if (AlgoNameIs("daggerhashimoto"))
            {
                NumRetries = Config.ConfigData.EthMinerAPIGraceMinutes * 60 / Config.ConfigData.MinerAPIQueryInterval;
                ER.Start();
                P.StartInfo.FileName = Ethereum.EtherMinerPath;
            }
            else
            {
                P.StartInfo.FileName = Path;
            }

            P.StartInfo.Arguments      = LastCommandLine;
            P.StartInfo.CreateNoWindow = Config.ConfigData.HideMiningWindows;
            //P.StartInfo.UseShellExecute = !Config.ConfigData.HideMiningWindows;
            P.StartInfo.UseShellExecute = false;
            //P.EnableRaisingEvents = true;
            //P.Exited += Miner_Exited;
            P.ExitEvent = Miner_Exited;

            try
            {
                if (P.Start())
                {
                    return(P);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                Helpers.ConsolePrint(MinerDeviceName, "_Start: " + ex.Message);
                return(null);
            }
        }
All Usage Examples Of NiceHashMiner.EthminerReader::Start