static void Main(string[] args) { EventLog eventLog = null; try { if (!System.Diagnostics.EventLog.SourceExists("HLHive")) { System.Diagnostics.EventLog.CreateEventSource("HLHive", "HiveSlave"); } eventLog = new EventLog(); eventLog.Source = "HLHive"; eventLog.Log = "HiveSlave"; } catch (Exception) { } //slave part Core core = new Core(); core.ServiceEventLog = eventLog; Console.WriteLine("Starting core ..."); Thread coreThread = new Thread(core.Start); coreThread.IsBackground = true; //dont keep app alive coreThread.Start(); Thread.Sleep(1000); //mock a slave client SlaveCommListener listener = new SlaveCommListener(); listener.Open(); Console.WriteLine("Press a key to quit"); Console.ReadLine(); listener.Close(); core.Shutdown(); Console.ReadLine(); }
static void Main(string[] args) { EventLog eventLog = null; try { if (!System.Diagnostics.EventLog.SourceExists("HLHive")) { System.Diagnostics.EventLog.CreateEventSource("HLHive", "HiveSlave"); } eventLog = new EventLog(); eventLog.Source = "HLHive"; eventLog.Log = "HiveSlave"; } catch (Exception) { } //slave part Core core = new Core(); core.ServiceEventLog = eventLog; Console.WriteLine("Starting core ..."); Thread coreThread = new Thread(core.Start); coreThread.IsBackground = true; //dont keep app alive coreThread.Start(); Thread.Sleep(1000); //mock a slave client SlaveCommListener listener = new SlaveCommListener(); listener.Open(); Console.WriteLine("Press a key to quit"); Console.ReadLine(); listener.Close(); core.Shutdown(); Console.ReadLine(); }