Example #1
0
        public HttpContextManager(WorkConfig workConfig, HandlerManager manager, HttpServerUtility serverUtility)
        {
            _handlerManager = manager;
            _workConfig     = workConfig;
            _serverUtility  = serverUtility;

            currentQueueNum = 0;
            _processQueue   = new ProcessQueue();
            this.StartWorkThread();
        }
Example #2
0
        private Thread _listenThread; //请求监听的线程

        public HttpServer(String configPath = null)
        {
            _httpListener = new HttpListener();
            this.Initialize(configPath);
            _httpServerUtility = new HttpServerUtility(_serverConfig);

            _handlerManager     = new HandlerManager(_serverConfig.HandlerConfig, _httpServerUtility);
            _httpContentManager = new HttpContextManager(_serverConfig.WorkConfig, _handlerManager, _httpServerUtility);


            _listenThread = new Thread(HttpListen);
            _listenThread.Start();
        }