CookComputing.XmlRpc.XmlRpcListenerService.ProcessRequest C# (CSharp) Method

ProcessRequest() public method

public ProcessRequest ( HttpListenerContext RequestContext ) : void
RequestContext System.Net.HttpListenerContext
return void
        public virtual void ProcessRequest(HttpListenerContext RequestContext)
        {
            try
              {
            IHttpRequest req = new XmlRpcListenerRequest(RequestContext.Request);
            IHttpResponse resp = new XmlRpcListenerResponse(RequestContext.Response);
            resp.SendChunked = _sendChunked;
            HandleHttpRequest(req, resp);
            RequestContext.Response.OutputStream.Close();
              }
              catch (Exception ex)
              {
            // "Internal server error"
            RequestContext.Response.StatusCode = 500;
            RequestContext.Response.StatusDescription = ex.Message;
              }
        }

Usage Example

Esempio n. 1
0
 public void Run()
 {
     try
     {
         while (_running)
         {
             HttpListenerContext context = _lstner.GetContext();
             context.Response.Headers.Add("BarHeader", "BarValue");
             context.Response.Cookies.Add(new Cookie("FooCookie", "FooValue"));
             _svc.ProcessRequest(context);
         }
     }
     catch (HttpListenerException)
     {
     }
 }
XmlRpcListenerService