示例#1
0
        public Listener(DomainPath domainPath, RequestsQueue requestsQueue)
        {
            _domainPath    = domainPath;
            _requestsQueue = requestsQueue;
            var domains = _domainPath.GetAllDomains();

            _httpListener = new HttpListener();
            foreach (var domain in domains)
            {
                _httpListener.Prefixes.Add("http://" + domain);
            }
        }
        public void Start()
        {
            _domainPath    = new DomainPath();
            _requestsQueue = new RequestsQueue();
            _domainPath.MapPathToDomain(8080, "WebPages");
            _domainPath.MapPathToDomain(4000, "MyProject");
            var listen   = new Thread(Listen);
            var response = new Thread(GetContext);

            listen.Start();
            response.Start();
        }
 public Dispatcher(HttpListenerContext httpListenerContext, DomainPath domainPath)
 {
     _httpListenerContext = httpListenerContext;
     _domainPath          = domainPath;
 }