static void Main(string[] args) { var counter = new Counter(); var server = new RouteServer <Counter>(counter); server.StartAsync(); Console.Write("Press Enter twice to stop.."); Console.ReadLine(); Console.ReadLine(); server.Stop(); Console.WriteLine("Server stopped"); }
public static void StartDaemon(RouteServer server) { var waiter = new ManualResetEvent(false); Console.CancelKeyPress += (o, e) => { e.Cancel = true; waiter.Set(); }; server.StartAsync(); Console.WriteLine("pgom.lightpost started.. press ctrl+c to stop"); waiter.WaitOne(); server.Stop(); }
public void Stop() { CallInServer.Stop(); LogHelper.WriteLog("CallInServer已关闭"); CarLocationServer.Stop(); LogHelper.WriteLog("CarLocationServer已关闭"); OtherMsgServer.Stop(); LogHelper.WriteLog("OtherMsgServer已关闭"); CT.Stop(); LogHelper.WriteLog("CallInfo数据库连接检测线程已关闭"); CI.Stop(); LogHelper.WriteLog("CallInfo数据分析服务已关闭"); QC.Stop(); LogHelper.WriteLog("QualityComment数据分析服务已关闭"); }
/// <summary> /// 停止数据交换服务 /// </summary> public void StopService() { CallInServer.Stop(); CarLocationServer.Stop(); OtherMsgServer.Stop(); if (bs != null) { bs.Stop(); } if (bsTcp != null) { bsTcp.Stop(); } if (gs != null) { gs.Stop(); } }
static void Main(string[] args) { var bundle = new BundleManager("bundles", "current.txt"); var server = new RouteServer <Server>(new Server(), host: "localhost", port: 4000); var adminServer = new RouteServer <AdminServer>(new AdminServer(), host: "localhost", port: 4040); server.StartAsync(); adminServer.StartAsync(); Console.WriteLine("press enter twice to stop.."); Console.ReadLine(); Console.ReadLine(); server.Stop(); adminServer.Stop(); Console.WriteLine("server stopped"); }
static void Main(string[] args) { var simul = new SimulationServer(typeof(ExampleGame)); var frontend = new FrontEndServer("FrontEnd", "index.html"); var server = new RouteServer <SimulationServer>(simul); server.AppendRoutes(frontend); var waiter = new ManualResetEvent(false); Console.CancelKeyPress += (o, e) => { e.Cancel = true; waiter.Set(); }; server.StartAsync(); Console.WriteLine("tart started.. press ctrl+c to stop"); waiter.WaitOne(); server.Stop(); }