public bool SubFirehose(Firehose firehose) { lock (m_firehoses) { foreach (Firehose h in m_firehoses) { if (h.GetUniqueId() == firehose.GetUniqueId()) { return(false); } } m_firehoses.Add(firehose); return(true); } }
public bool UnSubFirehost(Firehose firehose) { lock (m_firehoses) { for (int i = 0; i < m_firehoses.Count; i++) { if (m_firehoses[i].GetUniqueId() == firehose.GetUniqueId()) { m_firehoses.RemoveAt(i); return(true); } } return(false); } }
public static void Main(string[] args) { MixerUtils.Init(); Carl c = new Carl(); if (!c.Run(args)) { return; } // Setup the commander dan. Firehose hose = new Firehose(c); c.SubFirehose(hose); CommandDan dan = new CommandDan(c, hose); // Setup message Dan hose = new Firehose(c); c.SubFirehose(hose); MessagesDan messagesDan = new MessagesDan(hose); // Notification Dan hose = new Firehose(c); c.SubFirehose(hose); FriendlyDan friendlyDan = new FriendlyDan(hose); while (true) { Thread.Sleep(500000); } //var host = new WebHostBuilder() // .UseKestrel() // .UseContentRoot(Directory.GetCurrentDirectory()) // .UseIISIntegration() // .UseStartup<Startup>() // .Build(); //host.Run(); }