Exemplo n.º 1
0
        public void RouteUrl(Server server)
        {
            Console.WriteLine(_request.Port);
            BaseController controller = null;
            if (_request.Port == ServerConfig.WebPort)
            {
                controller = new ServerController();
            }
            else if (_request.Port == ServerConfig.ControlPort)
            {
                controller = new ControlServerController();
            }
            controller.Request = _request;
            controller.Response = _response;
            controller.Server = server;

            controller.Init();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            // Set maximum number of threads
            ThreadPool.SetMaxThreads(20, 20);

            ServerConfig.Init();

            Logger = new Logger.Logger();

            server = new Server.Server(ServerConfig.Webroot, IPAddress.Any, ServerConfig.WebPort);
            cServer = new ControlServer.ControlServer(ServerConfig.Controlroot, IPAddress.Any, ServerConfig.ControlPort);

            server.ServerName = "Webserver";
            cServer.ServerName = "Controlserver";

            Logger.Start();
            StartServers();

            Console.Read();

            OnProcessExit();
        }