Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
638 views
in Technique[技术] by (71.8m points)

c# - notify client from server

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

Check this sites for comet with asp.net

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

or

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...