public Service() { try { InitializeComponent(); wsr = new Router(); workerThread = new Thread(wsr.Start); } catch (Exception e) { Log.Fatal("Failed to start service", e); throw e; } }
public static void Main(String[] args) { if (args.Count() == 0) { Log.Info("Starting service"); ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new Service() }; ServiceBase.Run(ServicesToRun); } else { Log.Info("Starting"); Router wsr = new Router(); wsr.Start(); } }