Re: [Cppcms-users] Server Sent events and CppCMS
Brought to you by:
artyom-beilis
From: Barbu P. - G. <bar...@gm...> - 2012-08-09 11:59:26
|
On 08/09/2012 02:23 PM, Artyom Beilis wrote: > > >> On 08/09/2012 01:29 PM, Artyom Beilis wrote: >>> Are you familiar with this? >>> >>> http://cppcms.com/wikipp/en/page/cppcms_1x#Comet.Programming >> >> No, I haven't followed that part of the tutorial, but I read it. >> But thinking of it ... >> >> Will it work if instead of the long pooling connection I'll use the >> EventStream in JS? > > I'm not familiar with EventStream of JS. But if it supports server > side events... Than it does either long polling or some sort of streaming > like hidden iframe or "never-ending" javascript etc. > > There are many COMET techniques. http://www.w3.org/TR/eventsource/ > > async_complete_response does what is defined - completes the response and > closes the connection. The client is expected to reopen one - send a new > XHR and wait again - also note that you can't get partial content > using XHR API. > > If you want to not complete the response use async_flush_output > with completion handler. > Hmm, when I'll have some free time I'll modify your coment example and try to make it work with SSE. Wish me luck :) Thank you for your time! -- Barbu Paul - Gheorghe Common sense is not so common - Voltaire Visit My GitHub profile to see my open-source projects - https://github.com/paullik |