static void Main(string[] args) { Thread TurtleServerThread = new Thread(o => { server = new TurtleServer(); }); TurtleServerThread.Name = "ServerThread"; TurtleServerThread.Start(); Console.WriteLine("Success"); Thread WebsocketTurtleThread = new Thread(o => { webserver = new WebSocketTurtleServer(); }); WebsocketTurtleThread.Name = "WebsocketThread"; WebsocketTurtleThread.Start(); while (true) { Console.Write(">"); string command = Console.ReadLine(); if (command == "exit") { break; } } }
static void Main(string[] args) { ServicePointManager.DefaultConnectionLimit = 1000; ServicePointManager.MaxServicePoints = 1000; ThreadPool.SetMinThreads(10, 10); MessageConverter.Initialize(); int i; int.TryParse(ConfigurationManager.AppSettings.Get("TurtleServerPort"), out i); TurtleServer.Start(i); int.TryParse(ConfigurationManager.AppSettings.Get("ClientServerPort"), out i); ClientServer.Start(i); int.TryParse(ConfigurationManager.AppSettings.Get("WebSocketTurtleServerPort"), out i); WebSocketTurtleServer.Start(i); AuthManager.Initialize("MyData"); Info("Success"); Console.ReadLine(); }