来自服务器的客户端通知 [英] Client Notification From Server

查看:89
本文介绍了来自服务器的客户端通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友.
我正在设计一个要求如下的系统:
我必须通过AJAX将大文件(10mb +)发送到asp.net.该文件将在服务器中排序,这将需要一些时间.我必须准确地通知客户排序的状态.假设我正在从文件中排序100组数据.在这种情况下,我必须在每个集合的排序完成后通知客户端.
我该怎么办?
任何与实现链接的建议都将受到高度赞赏.

Hello friends.
I am designing a system where the requirement is as follows:
I have to send a large file (10mb +) to asp.net through AJAX. The file will be sorted in the server and it will take time. I have to notify the client the status of the sorting accurately.Suppose I am sorting 100 sets of data from the file. In this case I have to notify the client after sorting of each set is finished.
How can I do it?
Any suggestion with link to implementation would be highly appreciated.

推荐答案

您可以通过拖曳方式实现它

-在客户端,运行一个计时器,该计时器将定期检查数据库是否有可用的通知,并且通知会更新数据库.
-其次,一旦完成排序,就可以通过SignalR在客户端和服务器端使用此方法注册,然后调用此方法.该方法将通过Jsrcipt在客户端自动通知.
http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongrunningConnectionsWithSignalR.aspx /<
You can achieve it through tow way

- On client side, run a timer that will check periodically if any notification available from DB and for notification update the database.
- Second is, use SignalR through this register a method on client side and on server side once you done your sorting then call this method. That method will notify automatically on client side through Jsrcipt.
http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongrunningConnectionsWithSignalR.aspx[^]


这篇关于来自服务器的客户端通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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