Re: [Cppcms-users] bandwidth throtteling
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2013-03-18 19:14:02
|
Once you called async_flush_output you must wait for completion handler to be executed before you send more data. For example "state" sse service does exactly the same it sends only latest data and if some was missed between async_flush_output and completion handler it would not be sent, but rather latest data should be. About buffering, when you work with async app. the write to response().out() just collects the data to the buffer, the I/O is performed uput async_flush_output request and than you can continue once you receive the notification. So in general what you described is reasonable approach. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Markus Raab <us...@ma...> >To: cpp...@li... >Sent: Monday, March 18, 2013 12:54 PM >Subject: [Cppcms-users] bandwidth throtteling > >Hello! > >Is it possible to do some bandwidth throtteling for an asynchronous >application? > >The idea is to drop some data in a stream using SSE when the connection is >too slow to send everything. > >What happens if more data is sent with async_flush_output than the client >(connection) can handle. Which part of the system does the buffering in this >scenario? > >A simple approach for the bandwidth throtteling would be to get a number how >many async_flush_output are currently unprocessed (e.g. by increment when >async_flush_output is registered and decrement inside the callback) - and >based on that number - drop data. Is this an useful approach? > >best regards >Markus > > >------------------------------------------------------------------------------ >Everyone hates slow websites. So do we. >Make your web apps faster with AppDynamics >Download AppDynamics Lite for free today: >http://p.sf.net/sfu/appdyn_d2d_mar >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > Se |