// IHttpAsyncHandler // public IAsyncResult BeginProcessRequest(HttpContext ctx, AsyncCallback cb, object extraData) { //BreakIfRequested(); ctx.Response.Buffer = false; /* ctx.Response.Output.Write("IHttpAsyncHandler.BeginProcessRequest called on thread {0}<br/>", Thread.CurrentThread.ManagedThreadId); ctx.Response.Output.Write("HttpContext.Current = {0}<br/>", (HttpContext.Current == null ? "n/a" : HttpContext.Current.ToString())); * */ var reqState = new AsyncRequestState(ctx, cb, extraData); ThreadPool.PostRequest(new DevelopMentor.WorkRequestDelegate(ProcessRequest), reqState); return (reqState); }
IAsyncResult IHttpAsyncHandler.BeginProcessRequest (HttpContext context, AsyncCallback cb, object extraData) { this.context = context; done.Reset (); begin_iar = new AsyncRequestState (done, cb, extraData); #if TARGET_JVM if (true) #else if (Thread.CurrentThread.IsThreadPoolThread) #endif Start (null); else ThreadPool.QueueUserWorkItem (new WaitCallback (Start), null); return begin_iar; }
void IHttpAsyncHandler.EndProcessRequest (IAsyncResult result) { if (!result.IsCompleted) result.AsyncWaitHandle.WaitOne (); begin_iar = null; }
void IHttpHandler.ProcessRequest (HttpContext context) { begin_iar = null; this.context = context; done.Reset (); Start (null); done.WaitOne (); }