Hey Zhang, 2010/3/9 <[email protected]>: >> Not really. When you do a server push to an application which closed >> the browser, this will eventually timeout. >> The simplechat example works exactly this way. > > I havn't seen any structure that stored the WApplication::instance in > Simplechat, > It uses the Signal/Slot mechanism, not global variable, Am I right? Or the > Signal/Slot mechanism is a way to store the WApplication::instance?
Indirectly yes, the signal will be connected to slots that reference SimpleChatWidget instances within different WApplication's. There is not a real difference in referencing a WApplication or one of its widgets. You could also explicitly reference the widget or application, but then you need to also take care that you remove the instance from the global list from within its destructor. The benefit of using signals and slots is that they implement this already using automated connection management. Regards, koen ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
