Support #4853
closedModel data on server side
0%
Description
Hi! I am just starting with Wt C and I only see examples with models on client side. In other words, each time a page is loaded, a new model is created. I have a server doing some data collection. Is it possible to expose the same data to all clients?
And, each time a row is added to the model, all clients should be updated.
Any C example or hint is appreciated folks.
Martin
BTW:
Passing a model pointer with the addEntryPoint function results in a segm fault when the model wants to update the view:
server.addEntryPoint(Wt::Application, boost::bind(createApplication, _1, boost::ref(model)));
Updated by Wim Dumon over 8 years ago
- Status changed from New to Resolved
Hey Martin,
shared models (i.e. one model shared by many sessions) are not support in Wt. You will have to instantiate your model in each class separately, and for the data updates I suggest that when the data changes, you use WServer::post() to notify all sessions that a data update is to be performed.
Wim.
Updated by Koen Deforche over 8 years ago
- Status changed from Resolved to Closed
- Target version set to 3.3.6