Example #1
0
 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;
     }
 }
Example #2
0
 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;
       }
 }
 public virtual void ProcessRequest(HttpListenerContext RequestContext)
 {
     try
     {
         var req = new XmlRpcListenerRequest(RequestContext.Request);
         IHttpResponse resp = new XmlRpcListenerResponse(RequestContext.Response);
         resp.SendChunked = SendChunked;
         HandleHttpRequest(req, resp);
     }
     catch (Exception ex)
     {
         // "Internal server error"
         RequestContext.Response.StatusCode = 500;
         RequestContext.Response.StatusDescription = ex.Message;
     }
     finally
     {
         try
         {
             RequestContext.Response.OutputStream.Close();
         }
         catch (InvalidOperationException)
         {
             // Zev Beckerman reported that this exception was something being thrown
             // by the call to Close - following seemed to handle the problem
             try
             {
                 RequestContext.Response.OutputStream.Flush();
                 System.Threading.Thread.Sleep(10000);
                 RequestContext.Response.OutputStream.Close();
             }
             catch
             {
                 /* intentionally left blank */
             }
         }
     }
 }
Example #4
0
 public virtual void ProcessRequest(HttpListenerContext RequestContext)
 {
     try
     {
         var           req  = new XmlRpcListenerRequest(RequestContext.Request);
         IHttpResponse resp = new XmlRpcListenerResponse(RequestContext.Response);
         resp.SendChunked = SendChunked;
         HandleHttpRequest(req, resp);
     }
     catch (Exception ex)
     {
         // "Internal server error"
         RequestContext.Response.StatusCode        = 500;
         RequestContext.Response.StatusDescription = ex.Message;
     }
     finally
     {
         try
         {
             RequestContext.Response.OutputStream.Close();
         }
         catch (InvalidOperationException)
         {
             // Zev Beckerman reported that this exception was something being thrown
             // by the call to Close - following seemed to handle the problem
             try
             {
                 RequestContext.Response.OutputStream.Flush();
                 System.Threading.Thread.Sleep(10000);
                 RequestContext.Response.OutputStream.Close();
             }
             catch
             {
                 /* intentionally left blank */
             }
         }
     }
 }