How to do long-polling AJAX requests in ASP.NET MVC? [duplicate]

纵饮孤独 提交于 2019-11-27 04:13:38

问题


This question already has an answer here:

  • Comet implementation for ASP.NET? [closed] 8 answers

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.


回答1:


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

You can use the example on a AppHarbor deployment I set up based on the source from the BitBucket project.

Also, more information available from my blog post explaining the project.



来源:https://stackoverflow.com/questions/1342216/how-to-do-long-polling-ajax-requests-in-asp-net-mvc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!