如何做到在ASP.NET MVC长轮询AJAX请求? [英] How to do long-polling AJAX requests in ASP.NET MVC?

查看:158
本文介绍了如何做到在ASP.NET MVC长轮询AJAX请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆