/// <summary> /// 构造函数 /// </summary> private CoreService() { CallInServer = new RouteServer(); CallInServer.ServerIP = SysParameters.AppRouteServerIP; CallInServer.ServerPort = SysParameters.CallInServerPort; CarLocationServer = new RouteServer(); CarLocationServer.ServerIP = SysParameters.AppRouteServerIP; CarLocationServer.ServerPort = SysParameters.CarLocationServerPort; OtherMsgServer = new RouteServer(); OtherMsgServer.ServerIP = SysParameters.AppRouteServerIP; OtherMsgServer.ServerPort = SysParameters.OtherMsgServerPort; if (SysParameters.ApplyVersion == "OLD") { bs = new BServer(); bs.strRemoteIP = SysParameters.BServerIP; bs.nRemotePort = SysParameters.BServerPort; bs.nLocalPort = SysParameters.BLocalPort; gs = new GServer(); gs.nLocalPort = SysParameters.GLocalPort; } else if (SysParameters.ApplyVersion == "NEW") { bsTcp = new BServerClient(); bsTcp.strRemoteIP = SysParameters.BServerIP; bsTcp.nRemotePort = SysParameters.BServerPort; bsTcp.nLocalPort = SysParameters.BLocalPort; } }
public RouteServerTest() { server = new TestServer(); runner = new RouteServer(port: port); runner.AppendRoutes(server); runner.HandleErrorToConsole = false; runner.StartAsync(); }
private CoreService() { CallInServer = new RouteServer(); CarLocationServer = new RouteServer(); OtherMsgServer = new RouteServer(); CI = new CallInfo(); QC = new QualityComment(); CT = new ConnectTest(); }
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(); }
static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("usage: pgom.lightpost {auth}"); return; } var post = new LPServer("posts.db", args[0]); var statics = new StaticsServer("statics", "index.html"); var server = new RouteServer(port: 4001); server.AppendRoutes(post, "lp"); server.AppendRoutes(statics, "lp"); StartDaemon(server); }
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(); }