Exemplo n.º 1
0
        private void SafeCloseBfgMiner()
        {
            if (_rpcThread != null)
            {
                _rpcThread.Stop();
                _rpcThread = null;
            }

            LOG.Info("Try to close BfgMiner.");

            if (_processMiner != null)
            {
                try
                {
                    _processMiner.Kill();
                    _processMiner = null;
                }
                catch (Exception ex)
                {
                    LOG.Error(ex);
                }
            }

            TryKillBfgMiner();
        }
Exemplo n.º 2
0
        // start BfgMiner and request data through RPC
        private void RunMinerAndMonitorData()
        {
            string arguments = _appConfig.MinerInfo.GetCommandLine();

            LOG.Info("arguments: " + arguments);

            if (!string.IsNullOrEmpty(arguments))
            {
                _processMiner = _processManager.RunApplication2(Constants.BfgMinerFileName, _bfgMinerPath, arguments);

                Thread.Sleep(5000);
                _rpcThread = new RPCThread(Constants.BfgMinerServerAddress, Constants.BfgMinerServerPort, this.OnDataReceived);
                _rpcThread.Start(_appConfig.DebugData);
            }
        }
Exemplo n.º 3
0
        private void SafeCloseBfgMiner()
        {
            if (_rpcThread != null)
            {
                _rpcThread.Stop();
                _rpcThread = null;
            }

            LOG.Info("Try to close BfgMiner.");

            if (_processMiner != null)
            {
                try
                {
                    _processMiner.Kill();
                    _processMiner = null;
                }
                catch (Exception ex)
                {
                    LOG.Error(ex);
                }
            }

            TryKillBfgMiner();
        }
Exemplo n.º 4
0
        // start BfgMiner and request data through RPC
        private void RunMinerAndMonitorData()
        {
            string arguments = _appConfig.MinerInfo.GetCommandLine();
            LOG.Info("arguments: " + arguments);

            if (!string.IsNullOrEmpty(arguments))
            {
                _processMiner = _processManager.RunApplication2(Constants.BfgMinerFileName, _bfgMinerPath, arguments);

                Thread.Sleep(5000);
                _rpcThread = new RPCThread(Constants.BfgMinerServerAddress, Constants.BfgMinerServerPort, this.OnDataReceived);
                _rpcThread.Start(_appConfig.DebugData);
            }
        }