2

I did a lot of search, found some topics like Detect that the Internet connection is offline? but they don't solve my problem.

When I took a look at Google Doc(maybe Gmail use the same way) product, its Internet connectivity checker looks great and almost got notified in real time once you turned off your WiFi.

If you turn on Chrome's Network Monitor, there are http requests: https://0.docs.google.com/document/d/1muWJEAPZU2meqlBg4_69osnscaM1GpxkOK--H7r-f44/bind?id=... and restarts every minutes(55 seconds around)

When you turn off the WiFi, the long polling request get interrupted by ERR_NETWORK_CHANGED.

I try to implement something like this on my own machine, but my long polling request never got interrupted or exception (I use tornado web framework and google chrome)

Is there anyone can show me the magic part that how Google doc checks its connectivity?

Community
  • 1
  • 1
kernel1983
  • 21
  • 2
  • Could it be your server and browser are on the same machine so it's a loopback? – cshu Jan 06 '15 at 09:00
  • The server is remote, the browser was visiting another page on the local server. So on the page, it try to ajax an long polling file from the remote test server – kernel1983 Jan 06 '15 at 09:08

0 Answers0