从服务器的客户端通知 [英] notify client from server

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

问题描述

如果我有一个asp.net应用程序,我想通知用户的东西时在服务器上的变化,我怎么做到这一点。
与Silverlight客户端同样的事情。对于Silverlight客户端是有某种形式从Silverlight客户端订阅事件在服务器上的?

If I have an asp.net application, and I want to notify the user when something changes on the server, how do I do this. The same thing with a silverlight client. For the silverlight client is there some form of subscribing to an event on the server from the silverlight client?

推荐答案

有2种方式。
第一个是检查每隔几分钟你的服务器,但我相信,你没有搜索这个明显的方式,您搜索的另一种技术调用彗星。

There are 2 ways. The first one is to check your server every few minutes, but I believe that you do not search for this obvious way, you search for another technique that called comet.

彗星技术 创建并打开连接到您的从客户端服务器,在服务器关闭的连接,这意味着没有为您的客户一个新的消息,您的客户端读取邮件,并打开一个新的连接等待下一条消息。另一种方法是只打开一个连接和流中的数据,当可从服务器到客户端他们,而不是在所有关闭连接。你需要照顾的唯一的事情是增加允许你的网站打开的连接数。

Comet technique creates and opens connection to your server from the client, and when the server closes the connection, it means that there is a new message for your client, your client reads the messages, and opens a new connection waiting for the next message. The other way is to just open a connection and stream the data, when they are available from the server to the client, and not to close the connection at all. The only thing that you need to take care of is to increase the number of open connections that allowed to your site.

检查该网站与asp.net彗星

Check this sites for comet with asp.net

http://www.frozenmountain.com/websync/

http://www.aaronlerch.com/blog/2007/07/08/creating-comet-applications-with-aspnet/

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

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