@@ -33,6 +33,10 @@ typedef int socklen_t;
3333 * This is a minimal socket notifier example, which is used to asynchronously
3434 * read an RSS file and display it in raw format on the browser using server
3535 * push.
36+ * Note that when the SocketNotifier signal is emitted, that Wt already
37+ * conveniently grabbed the update lock for you. You can simply modify
38+ * the widget tree and use the server push mechanism to push the changes
39+ * to the browser.
3640 * The example looks unnecessary complex due to the use of the raw POSIX
3741 * socket functions. Usually these are wrapped in a more programmer-friendly
3842 * API.
@@ -72,11 +76,9 @@ private:
7276 Wt ::WText * rssText_ ;
7377 std ::stringstream inStream_ ;
7478
75- // Convenience function that updates the status message. It grabs
76- // the updateLock before doing so, so it is safe to call at any time.
79+ // Convenience function that updates the status message.
7780 void addText (const Wt ::WString & text )
7881 {
79- Wt ::WApplication ::UpdateLock uiLock = wApp -> getUpdateLock ();
8082 resultText_ -> setText (resultText_ -> text () + text );
8183 if (wApp -> updatesEnabled ())
8284 wApp -> triggerUpdate ();
@@ -237,9 +239,6 @@ private:
237239
238240 void cleanup ()
239241 {
240- // We'll be modifying the widget tree
241- Wt ::WApplication ::UpdateLock uiLock = wApp -> getUpdateLock ();
242-
243242 /*
244243 * It is mandatory not to have notifiers on closed sockets,
245244 * as select() fails miserably in this case. Disable (or even
0 commit comments