Author: gonzalo
Date: 2005-08-31 19:33:52 -0400 (Wed, 31 Aug 2005)
New Revision: 49232

Added:
   trunk/xsp/test/1.1/handlers/async.ashx
Log:
test for IHttpAsyncHandler

Added: trunk/xsp/test/1.1/handlers/async.ashx
===================================================================
--- trunk/xsp/test/1.1/handlers/async.ashx      2005-08-31 23:20:56 UTC (rev 
49231)
+++ trunk/xsp/test/1.1/handlers/async.ashx      2005-08-31 23:33:52 UTC (rev 
49232)
@@ -0,0 +1,42 @@
+<%@ WebHandler Language="c#" class="XSPTest.AsyncTest" debug="true" %>
+
+using System;
+using System.Web;
+using System.Threading;
+
+namespace XSPTest
+{
+       public class AsyncTest : IHttpAsyncHandler
+       {
+               EventHandler evt;
+               HttpContext context;
+               
+               void Func (object o, EventArgs args)
+               {
+                       context.Response.Write ("In async callback\n");
+                       context.Response.ContentType = "text/plain";
+               }
+
+               public void ProcessRequest (HttpContext context)
+               {
+                       throw new Exception ("Should not be called");
+               }
+
+               public IAsyncResult BeginProcessRequest (HttpContext context, 
AsyncCallback cb, object state)
+               {
+                       this.context = context;
+                       evt = new EventHandler (Func);
+                       return evt.BeginInvoke (null, null, cb, state);
+               }
+
+               public void EndProcessRequest (IAsyncResult ares)
+               {
+                       context.Response.Write ("End request being invoked.");
+               }
+
+               public bool IsReusable {
+                       get { return false; }
+               }
+       }
+}
+

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to