Ejemplo n.º 1
0
        private void Start(List <Assembly> assemblies)
        {
            if (this.root != null && !Directory.Exists(this.root))
            {
                throw new DirectoryNotFoundException("root folder not found");
            }

            this.Connections = new List <HttpConnection>();
            this.Sessions    = new Dictionary <string, HttpSession>();

            this.Cache = new HttpCache(this);
            HttpController.LoadControllers(assemblies);
            HttpWebSocket.LoadControllers(assemblies);

            this.connectionWaitHandle = new AutoResetEvent(false);

            this.listenerLoopThread = new Thread(this.ListenerLoop)
            {
                Name         = "HttpServer Listener",
                IsBackground = true
            };
            this.listenerLoopThread.Start();
        }