public static void ExecuteSynchronous(HttpApplication context, string routeServiceVirtualPath, bool flowContext, bool ensureWFService)
        {
            AutoResetEvent wait = HostedHttpRequestAsyncResult.waitObject;

            if (wait == null)
            {
                wait = new AutoResetEvent(false);
                HostedHttpRequestAsyncResult.waitObject = wait;
            }

            HostedHttpRequestAsyncResult result;

            try
            {
                result = new HostedHttpRequestAsyncResult(context, routeServiceVirtualPath, flowContext, ensureWFService, ProcessRequestCompleteCallback, wait);
                if (!result.CompletedSynchronously)
                {
                    wait.WaitOne();
                }
                wait = null;
            }
            finally
            {
                if (wait != null)
                {
                    // Not sure of the state anymore.
                    HostedHttpRequestAsyncResult.waitObject = null;
                    wait.Close();
                }
            }

            HostedHttpRequestAsyncResult.End(result);
        }
 public static void EndProcessRequest(IAsyncResult ar)
 {
     if (ar is HostedHttpRequestAsyncResult)
     {
         HostedHttpRequestAsyncResult.End(ar);
     }
 }
示例#3
0
 static public void EndProcessRequest(IAsyncResult ar)
 {
     //No need to call CompletedAsyncResult.End as the asyncResult has already completed.
     if (ar is HostedHttpRequestAsyncResult)
     {
         HostedHttpRequestAsyncResult.End(ar);
     }
 }
 public void EndProcessRequest(IAsyncResult result)
 {
     HostedHttpRequestAsyncResult.End(result);
 }