There is a simple class added to the contrib section in trunk.
The Server-Sent Events support is provide in form of a generic class
sse::event_source that the user expected to derive from.
Also two simple event source objects with a predefined policy:
- Queue bounded up to certain capacity:
- Real time state updates that allows to keep clients updated with the latest events - rather than sending all the events from the beginning:
Examples of a simple chat and a stock ticker are provided.
sse::event_sourcesupports falling back to long polling using XHR by sending a special header, notifying the server that the connection should be closed rather than kept open.
- Also the code resides withing trunk, it is fully useful with current stable CppCMS release - 1.0.2.
- This code does nothing exceptional, you don't really have to use it to create SSE, it is just makes it easy to handle them without knowing too much about server-side event driven programming.