[Cppcms-users] One SSE stream per session
Brought to you by:
artyom-beilis
|
From: Christian G. <chr...@gm...> - 2013-03-13 08:33:54
|
Hi all.
at the moment I am looking how to have one SSE stream per session. In
general I would put the SSE stream object into the session storage but
I am not sure how I could access it from other cppcms-apps.
Here is brief overview:
I have an SSE application mounted at /sse/
booster::intrusive_ptr<SSE> sse = new SSE(srv);
Configuration::instance()->sse = sse.get();
srv.applications_pool().mount(sse, cppcms::mount_point("/sse(.*)", 1));
It is possible for all other cppcms apps running to send data via SSE
to the browser.
Configuration::instance()->sse->enqueue("event", "data");
class SSE : public cppcms::application {
public:
SSE(cppcms::service &srv);
void post();
void get();
void redirect();
void enqueue(std::string const &event, std::string const &data);
private:
booster::shared_ptr<sse::bounded_event_queue> stream_;
};
At the moment all clients are using the same SSE stream and this is a
no-go security wise.
So I want to extend my current approach to have multiple SSE streams -
for each session one.
As this "website" is used for embedded device configuration I think I
will not run into any
resource problems.
Or is there a better way to deliver each session their own data-packages only?
thanks
--
Christian Gmeiner, MSc
|