I'm writing an application that controls a weather radar. Only 1 user is allowed to control the radar at a time, the other users are in read-only mode. At any time, someone can take control of the radar, and other users are notified, via a WDialog.
I've adapted the ChatServer from the Wt examples/simplechat to notify other users that someone has taken control of the radar. If I let my application run for a while, and close various Wt web windows, I get the following exception: [2012-Nov-07 17:40:16.853950] 30410 [/ Ri6nRv7dPcrwokET] [info] "WebController: timeout: expiring" terminate called after throwing an instance of 'Wt::WException' what(): doRecursiveEventLoop(): session was killed Program received signal SIGABRT, Aborted. As shown below, WebSession.C throws an exception when a WebSession is "Dead": if (state_ == Dead) { recursiveEventLoop_ = 0; throw WException("doRecursiveEventLoop(): session was killed"); } #7 0x017678a1 in Wt::WebSession::doRecursiveEventLoop (this=0x87776a8) at /usr/local/src/wt-3.2.3/src/web/WebSession.C:1022 #8 0x0143a7da in Wt::WDialog::exec (this=0x8807000, animation=...) at /usr/local/src/wt-3.2.3/src/Wt/WDialog.C:292 #9 0x08124cc2 in Login_GUI::confirm (this=0x8806f90, message=..., info=..., id=..., passwd=..., name=..., location=..., comment=...) at src/view/Login_GUI.cpp:75 #10 0x0816d726 in UIServer::showLogin (this=0x8783b60, message=..., info=...) at src/view/UIServer.cpp:705 #11 0x0816e7a9 in UIServer::processStatusEvent (this=0x8783b60, event=...) at src/view/UIServer.cpp:904 What I need is some method of determining that a session is dead, so I can avoid posting an event that shows a dialog, e.g.: server_->post(i->second.sessionId, boost::bind(i->second.eventCallback, event)); if the session is already dead. Since the WebSession class is not part of the published Wt API, I can't check the result of WebSession::dead(). (That is, WebSession.h is not copied to <prefix>/Wt/include, and depends on other internal include files.) Also, I rarely see calls to my WApplication derived class destructor or finalize() methods after destroying a window, so I can't use these methods to cleanup my list of "clients". Any ideas on how to avoid posting events to already dead (zombie?) sessions? Thanks much! ------------------------------------------------------------------------------ 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_nov _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest