如何做到在ASP.NET MVC长轮询AJAX请求? [英] How to do long-polling AJAX requests in ASP.NET MVC?
问题描述
有谁知道如何code了长轮询AJAX请求(用于服务器PUSH通知)的ASP.NET MVC?每当我这样做,似乎只有最后一个浏览器打开一个窗口得到通知。仿佛IIS / ASP.NET取消了最后的请求,因为它是挂起或什么的。
Does anyone know how to code up long-polling AJAX requests (for server PUSH notifications) in ASP.NET MVC? Whenever I do it, it seems that only the last browser to open up a window gets the notifications. As if IIS/ASP.NET were canceling the last request because it was hung or something.
推荐答案
I recently wrote a simple example of a Long Polling Chat Server using MVC 3 Async Controllers based on a great article by Clay Lenhart
您可以使用例如在AppHarbor部署我建立了基于从项目BitBucket上的来源。
You can use the example on a AppHarbor deployment I set up based on the source from the BitBucket project.
另外,可以从我的博客的更多信息发布解释该项目。
这篇关于如何做到在ASP.NET MVC长轮询AJAX请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!