public override CommandResult Execute(string parameter)
        {
            minerLog     = new Logger();
            minerManager = new MinerManager(false);
            //// minerManager.SetLogger(minerLog);

            System.Timers.Timer timer = new System.Timers.Timer();
            timer.Interval = 1000;
            timer.Elapsed += new System.Timers.ElapsedEventHandler(this.OnTimerWork);
            timer.Start();

            Thread.Sleep(3000);

            /*
             * Task.Factory.StartNew(() => PingMiner());
             *
             * Thread.Sleep(3000);
             *
             * Task.Factory.StartNew(() => PingMiner());
             *
             * Thread.Sleep(3000);
             *
             * Task.Factory.StartNew(() => PingMiner());
             */

            MessageOutput message = MessageOutput.Create("Finished");

            return(CommandResult.CreateResult(message));
        }
 private CommandResult Detect()
 {
     try
     {
         string newInstanceId = serviceProvider.DetectAvailableInstanceId().ToString();
         return(CommandResult.CreateResult(MessageOutput.Create(newInstanceId)));
     }
     catch (Service.TimeoutException ex)
     {
         throw new TargetExecutionException(DaemonErrorCode.COMMAND_TIME_OUT, ex);
     }
     catch (TargetExecutionException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw new TargetExecutionException(DaemonErrorCode.UNKNOWN_ERROR, ex);
     }
 }