3 ms·
One alternative to repeated polling or Flash is hanging GETs. But yes, that's a pretty weird hack.
by Thorrez 6y ago
One alternative to repeated polling or Flash is hanging GETs. But yes, that's a pretty weird hack.
- cygx 6y agoThat's called 'long polling'. You can also leverage HTTP 1.1 chunked transfers. Cf https://en.wikipedia.org/wiki/Comet_(programming) https://en.wikipedia.org/wiki/Comet_(programming)
- arantius 6y agoThat's unidirectional. Websockets allow fully stateful bidirectional data transfer (just like a regular socket). They're wonderful when that's what you need.
- Thorrez 6y agoYeah, you pair hanging GETs with XHR to get bidirectional transfer. Yeah I agree websockets are a lot easier than the hacky hanging GETs + XHR setup.