質問

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