Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top