Re: [Cppcms-users] "endless" stream of data
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2011-12-27 13:57:03
|
Take a look on a function: cppcms::http::context::async_flush_output http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1http_1_1context.html#a134469b5dc46667596c360b8b7284dff Small notes: 1. Don't use finalize, it is not needed any more. 2. async_complete_response() - completes the response, and you don't want to. Take a look on the chat example, but instead of calling async_complete_response() you call async_flush_output() with a callback. Note: you need to release the context the same way it is done in chat example. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ >________________________________ > From: Marcel Hellwig <ke...@co...> >To: cpp...@li... >Sent: Tuesday, December 27, 2011 3:42 PM >Subject: [Cppcms-users] "endless" stream of data > > >Hi guys, > >I'd like to use some new, cool, trendy, hightech, modern and ultracool technique called SSE or ServerSentEvents (https://developer.mozilla.org/en/Server-sent_events/Using_server-sent_events) > >But to do that I'd like to make an endless stream of data like the PHP script does. But how to "flush" the data to the client? >I tried > >response().finalize() >>context().async_complete_response() (but i can't use it, because the object isn't useable for communication anymore) >> >> and some other tricks. So I want to now, how to make an asynchron, endless stream of data in cppcms. Maybe you can add an example for this, because it's HTML5, and that rocks ;) > >Regards > >Marcel Hellwig > >------------------------------------------------------------------------------ >Write once. Port to many. >Get the SDK and tools to simplify cross-platform app development. Create >new or port existing apps to sell to consumers worldwide. Explore the >Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join >http://p.sf.net/sfu/intel-appdev >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |