ihttpasynchandler

How to Make ASP.NET MVC Recognize IHttpAsyncHandler from IRouteHandler.GetHttpHandler() ?

In this question & answer, I found one way to make ASP.NET MVC support asynchronous processing. However, I cannot make it work. Basically, the idea is to create a new implementation of IRouteHandler which has only one method GetHttpHandler. The GetHttpHandler method should return a IHttpAsyncHandler implementation instead of just IHttpH...

IIS 7.0 503 errors with generic handler (.ashx) implementing IHttpAsyncHandler

I'm running into some performance issues using a generic handler that implements IHttpAsyncHandler. At its simplest, the handler receives a GET request, and 20 seconds later ends the response after writing '< timeout / >' to the response. When hammering the .ashx with 10000-20000 simultaneous requests, it fails with 503 server unavailab...

Can I define frequency check for ThreadPool.QueueUserWorkItem?

I implemented a System.Web.IHttpAsyncHandler to limit website bandwidth usage for files download. Once defined user bandwidth, I need to send a byte[] every second (or 1000 milliseconds, to be precise). Something like: public class DownloadHandler : IHttpAsyncHandler { public IAsyncResult BeginProcessRequest( HttpContext con...

Trouble sending file through IHttpAsyncHandler

I'm using a IHttpHandler to call a webservice and return the resulting byte[] to the client as a downloaded file attachment. This works fine, but when I tried changing the IHttpHandler to a IHttpAsyncHandler, the file download dialog shows, but the file does not start/finish downloading. What am I doing wrong? <%@ WebHandler Language...

IHttpAsyncHandler causes UnathorizedAccessException

Hey fellow geeks, For the last couple of days of my X-mas holidays, I have been struggling with an UnathorizedAccessException when trying to READ a XML file on a remote share through my ASP.NET application using an implementation of the IHttpAsyncHandler a long with the IRequiresSessionState. After much headache, and concluding that th...

Pattern for Reusable asynchronous HttpHandler

I'm currently developing a custom HttpHandler (for compressing/combining CSS, but that doesn't matter for this question). I started with a simple reusable=true synchronous HttpHandler like we all know. Now i'm trying to improve it to an asynchronous handler (as it uses IO functionality and it's used on a very busy website). My first a...

ASP.Net: IHttpAsyncHandler and IRequiresSessionState not working.

I have implemented an IHttpAsyncHandler. I am making about 5 different AJAX calls from a webpage that has widgets to that handler. One of those widgets takes about 15 seconds to load(because of a large database query) the others should all load in under a second. The handler is responding in a synchronous manner. I am getting very inc...

BLOB Reading via IHttpAsyncHandler

Hi, I am storing images in SQL Server 2000 database (BLOB type). There is a web page in my ASP.NET application which need to show a lot images to the end user and i want to handle browser's requests for images through a IHttpAsyncHandler. I found a similer post on codeproject "Asynchronous HTTP Handler for Asynchronous BLOB DataReader."...

IHttpAsyncHandler and IObservable web requests

Within Async handler I'm creating an IObservable from webrequest which returns a redirect string. I'm subscribing to that observable and calling AsyncResult.CompleteCall() but I'm forced to use Thread.Sleep(100) in order to get it executed. And it doesn't work every time. I'm pretty sure this is not correct. Could you please shine some ...

Why is IHttpAsyncHandler being called over IHttpHandler?

I made a custom handler that derives from MvcHandler. I have my routes using a custom RouteHandler that returns my new handler for GetHttpHandler(), and I override ProcessRequest() in my custom handler. The call to GetHttpHandler is triggering a breakpoint and my handler's constructor is definitely being called, but BeginProcessReques...

Why does IHttpAsyncHandler leak memory under load?

I have noticed that the .NET IHttpAsyncHandler (and the IHttpHandler, to a lesser degree) leak memory when subjected to concurrent web requests. In my tests, the Visual Studio web server (Cassini) jumps from 6MB memory to over 100MB, and once the test is finished, none of it is reclaimed. The problem can be reproduced easily. Create a ...

Unit testing async httphandler

If you have a Async HttpHandler as described here, how would one unit test? Would you create instance of the handler class itself or/and the IAsychResult class as well? Any example would be great.. Thx! ...