Esempio n. 1
0
        public string Process(HttpListenerContext context)
        {
            HttpListenerRequest request = context.Request;
            string url            = GetUrlofRequest(request);
            string responseToSend = _fileHandle.DataInFile(_fileHandle.FilePath(url, _url.GetAllPrefixes()));

            return(responseToSend);
        }
Esempio n. 2
0
 public void StartServer()
 {
     _listener = _requestListener.StartListening(_url.GetAllPrefixes());
     while (true)
     {
         OnRequestReceived(_listener);
     }
 }
Esempio n. 3
0
 public void StartServer()
 {
     _listener = _requestListener.StartListening(_url.GetAllPrefixes());
     new Thread(_ =>
     {
         while (true)
         {
             HttpListenerContext context   = _listener.GetContext();
             HttpListenerRequest request   = context.Request;
             HttpListenerResponse response = context.Response;
             string url            = _request.GetUrlofRequest(request);
             string responseToSend = _fileHandle.DataInFile(_fileHandle.FilePath(url, _url.GetAllPrefixes()));
             _response.SendResponse(response, responseToSend);
         }
     }).Start();
 }