. Net – send messages from server-side applications to clients?

I have a JavaScript - based client that is currently polling for new content Net web services Although polling works... I'm not satisfied with this method because I'm using system resources and creating overhead when no changes are received

My question is how to inform my customer that there is new content for it to display? I am willing to accept any other technology to implement this solution

Solution

First, voting is a feasible method You can use flash or Silverlight or comet – http://en.wikipedia.org/wiki/Comet_ (programming), which can keep the TCP connection open for notification The web page itself cannot open a socket, so it cannot notify the web client directly

[Edit] but think about how many clients can provide TCP connections to one server at the same time? For larger systems, with 65K ports available, the available slots will soon run out How many concurrent connections the server can handle depends on your hardware resources If you have enough memory and CPU, you should be able to handle ~ 100k or more However, if each request accesses the database or other resources through TCP / IP, it may be limited to the number of ports per available IP (65K) You should also push requests to separate domains, because browsers usually limit two concurrent connections to each domain, so you won't interfere with normal page loading

Combining polling with front - end cache server is a good solution You can use logic on the server to update each client's cache, thereby reducing the load per poll You can update the cache for users who log in / poll within X minutes to further reduce cache updates For me, pulling is easier and technically wise than pulling

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>