Re: [Cppcms-users] Server Sent events and CppCMS
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-08-09 11:23:24
|
> 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. > > And after broadcasting something to every waiter that initialized that > connectionit I shouldn't call waiter->async_complete_response(); so I > don't close the connection. > > Is that correct? 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. > > -- Barbu Paul - Gheorghe > Common sense is not so common - Voltaire > Visit My GitHub profile to see my open-source projects - > https://github.com/paullik > Regards, Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |