In tools like collabedit, when I inspect traffic in fiddler I see no polling from clients to server. However when some client writes new data to server, the other "magically" gets to know that and asks the server for update. How is this achieved without constant polling?

有帮助吗?

解决方案

This is achieved through long polling.

The code sends a request to http://collabedit.com/ot/wait.
The server doesn't respond until new data is available. When new data is available, the server sends a response, which is handled by the code.
Then, the cycle is repeated.

So, when the page is open, there's always a connection with the site.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top