public static void Run() { while (true) { try { //BTC.Do(); BCH.Do(); ETH.Do(); ETC.Do(); LTC.Do(); EOS.Do(); XRP.Do(); OMG.Do(); DASH.Do(); ZEC.Do(); Thread.Sleep(1000 * 5); // 创新 ITC.Do(); NAS.Do(); RUFF.Do(); ZIL.Do(); DTA.Do(); Thread.Sleep(1000 * 5); LET.Do(); HT.Do(); THETA.Do(); HSR.Do(); QTUM.Do(); Thread.Sleep(1000 * 5); SNT.Do(); IOST.Do(); NEO.Do(); STORJ.Do(); GNT.Do(); Thread.Sleep(1000 * 5); CVC.Do(); SMT.Do(); VEN.Do(); ELF.Do(); XEM.Do(); Thread.Sleep(1000 * 5); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }
// Manager: submitting state. We've just been given a command // and have sent it to mspdebug. Wait for mspdebug's // acknowledgement of receipt before doing anything further, // otherwise any cancellation requests we might want to send // could get lost without effect. void ManagerSubmitting(ITC.Primitive source) { Message msg; if (rawOutput.IsClosed) { Output.Close(); return; } if (rawOutput.TryReceive(out msg)) { Output.Send(msg); if ((msg.Type == MessageType.Shell) && (msg.Text.Equals("busy"))) { ManagerBusy(null); return; } } ITC.Pool.Continue(rawOutput, this.ManagerSubmitting); }
// Manager: ready state. mspdebug is sitting idle and waiting // for a command. void ManagerReady(ITC.Primitive source) { string cmd; if (Commands.IsClosed) { try { rawInput.Close(); } catch (Exception) { } ManagerExiting(null); return; } if (Commands.TryReceive(out cmd)) { try { rawInput.Write(":" + cmd + "\n"); } catch (Exception) { } ManagerSubmitting(null); return; } if (Cancel.Signalled) { Cancel.Clear(); CancelAccepted.Raise(); Ready.Raise(); } ITC.Pool.Continue(new ITC.Primitive[]{Cancel, Commands}, this.ManagerReady); }
// We've closed mspdebug's stdin and are now waiting for process // exit. void ManagerExiting(ITC.Primitive source) { Message msg; if (rawOutput.IsClosed) { Output.Close(); return; } if (rawOutput.TryReceive(out msg)) Output.Send(msg); ITC.Pool.Continue(rawOutput, this.ManagerExiting); }
// Manager: busy state. A command, or startup is in progress. We // move to the ready state once the command is finished. void ManagerBusy(ITC.Primitive source) { Message msg; if (rawOutput.IsClosed) { Output.Close(); return; } if (Cancel.Signalled) { try { rawInput.Write("\\break\n"); } catch (Exception) { } Cancel.Clear(); CancelAccepted.Raise(); } if (rawOutput.TryReceive(out msg)) { Output.Send(msg); if ((msg.Type == MessageType.Shell) && (msg.Text.Equals("ready"))) { Ready.Raise(); ManagerReady(null); return; } } ITC.Pool.Continue(new ITC.Primitive[]{Cancel, rawOutput}, this.ManagerBusy); }
// Clean up when the process exits. void CleanProcess(ITC.Primitive prim) { rawOutput.Close(); proc.WaitForExit(); }