문제

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