Ejemplo n.º 1
0
        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;
                }
            }
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 private static void DisconnectHandler(string label, HttpListenerRequest request, HttpListenerResponse response)
 {
     ClientServer.RemoveTurtle(label);
     WebSocketTurtleServer.UpdateList();
     CloseResponse(response);
 }