简体   繁体   中英

How do I implement long polling in MVC3 jquery application

I want to send a request to the server side from asp.net jquery html client side application.

the server side code will execute the task and once it completes, it will output some jpeg files.

the problem is that i want to automatically notify the web application when the jpegs are ready.

i am sending a call to the service every 2 seconds and it's polling way too much.

i want to somehow send a call to the server and then i want to get the response when the jpegs are in the directory.

i am using c# asp.net v4

SignalR是一个出色的客户端-服务器通信库,可以为您完成所有向后兼容的工作。

you can use Async Controller for such purpose. Please see this link for details Async controllers usage

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM