Ejemplo n.º 1
0
        public ServerRuntime(string path, List<IServerModule> modules, List<IServerHandler> handlers)
        {
            _path = path;
            _modules = modules;

            _router = new ServerRouter();
            foreach (IServerHandler handler in handlers) {
                _router.AddRoute(handler.RoutePattern, handler);
            }

            _modules.Add(this);
            for (int i = 0, moduleCount = _modules.Count; i < moduleCount - 2; i++) {
                _modules[i].InitializeModule(_modules[i + 1]);
            }

            _httpServer = Http.CreateServer();
            _httpServer.Request += OnHttpServerRequest;
        }
Ejemplo n.º 2
0
        public ServerRuntime(string path, List <IServerModule> modules, List <IServerHandler> handlers)
        {
            _path    = path;
            _modules = modules;

            _router = new ServerRouter();
            foreach (IServerHandler handler in handlers)
            {
                _router.AddRoute(handler.RoutePattern, handler);
            }

            _modules.Add(this);
            for (int i = 0, moduleCount = _modules.Count; i < moduleCount - 2; i++)
            {
                _modules[i].InitializeModule(_modules[i + 1]);
            }

            _httpServer          = Http.CreateServer();
            _httpServer.Request += OnHttpServerRequest;
        }