Thread: [Cppcms-users] Server-Sent Events Example
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-08-12 20:54:12
|
Published there: http://blog.cppcms.com/post/107 Thanks to Barbu Paul - Gheorghe for pointing me to this powerful HTML5 feature. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
From: Barbu P. - G. <bar...@gm...> - 2012-08-13 12:16:06
|
On 08/12/2012 11:54 PM, Artyom Beilis wrote: > Published there: > > http://blog.cppcms.com/post/107 Hey, I have to point out two mistakes: <title>Chat Room</title> In the_ticker.html Also there is the jQuery script in the_ticker.html that is not needed since you're using plain JS for this example. > Thanks to Barbu Paul - Gheorghe for pointing me to this powerful HTML5 feature. You're welcome, I'm glad I helped. -- Barbu Paul - Gheorghe Common sense is not so common - Voltaire Visit My GitHub profile to see my open-source projects - https://github.com/paullik |
From: Barbu P. - G. <bar...@gm...> - 2012-08-14 15:40:22
|
On 08/12/2012 11:54 PM, Artyom Beilis wrote: > Published there: > > http://blog.cppcms.com/post/107 Why did you write void main(std::string /*url*/) and not void main(std::string /url) ? -- Barbu Paul - Gheorghe Common sense is not so common - Voltaire Visit My GitHub profile to see my open-source projects - https://github.com/paullik |
From: Barbu P. - G. <bar...@gm...> - 2012-08-14 15:52:58
|
On 08/12/2012 11:54 PM, Artyom Beilis wrote: > Published there: > > http://blog.cppcms.com/post/107 Hi, I have a question about: context->async_on_peer_reset([=](){ this->waiters_.erase(context); }); Why are you catching things in the labda by value, not by reference? -- Barbu Paul - Gheorghe Common sense is not so common - Voltaire Visit My GitHub profile to see my open-source projects - https://github.com/paullik |
From: Artyom B. <art...@ya...> - 2012-08-14 19:04:36
|
----- Original Message ----- > From: Barbu Paul - Gheorghe <bar...@gm...> > To: Artyom Beilis <art...@ya...>; cpp...@li... > Cc: > Sent: Tuesday, August 14, 2012 6:40 PM > Subject: Re: [Cppcms-users] Server-Sent Events Example > > On 08/12/2012 11:54 PM, Artyom Beilis wrote: >> Published there: >> >> http://blog.cppcms.com/post/107 > > Why did you write > > void main(std::string /*url*/) > > and not > > void main(std::string /url) > > ? > Because I don't use URL dispatching so I don't need url variable, and this prevents warning about unused parameter with -Wall -Wextra > -- > Barbu Paul - Gheorghe > Common sense is not so common - Voltaire > Visit My GitHub profile to see my open-source projects - > https://github.com/paullik > Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
From: Barbu P. - G. <bar...@gm...> - 2012-08-14 19:26:27
|
On 08/14/2012 10:04 PM, Artyom Beilis wrote: > > Because I don't use URL dispatching so I don't need url variable, > and this prevents warning about unused parameter with -Wall -Wextra Got it, thank you! -- Barbu Paul - Gheorghe Common sense is not so common - Voltaire Visit My GitHub profile to see my open-source projects - https://github.com/paullik |
From: Artyom B. <art...@ya...> - 2012-08-14 19:06:59
|
----- Original Message ----- > From: Barbu Paul - Gheorghe <bar...@gm...> > To: Artyom Beilis <art...@ya...>; cpp...@li... > Cc: > Sent: Tuesday, August 14, 2012 6:52 PM > Subject: Re: [Cppcms-users] Server-Sent Events Example > > On 08/12/2012 11:54 PM, Artyom Beilis wrote: >> Published there: >> >> http://blog.cppcms.com/post/107 > > Hi, I have a question about: > > context->async_on_peer_reset([=](){ > this->waiters_.erase(context); > }); > > Why are you catching things in the labda by value, not by reference? > Because I need to variables: - "this" witch technically may be captured by reference as well, but not really needed. - "context" - the shared_ptr on the http::context that would go out of scope when the callback is called. > > -- > Barbu Paul - Gheorghe > Common sense is not so common - Voltaire > Visit My GitHub profile to see my open-source projects - > https://github.com/paullik > Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
From: Barbu P. - G. <bar...@gm...> - 2012-08-14 19:26:06
|
> Because I need to variables: > > - "this" witch technically may be > captured by reference as well, but not really needed. > - "context" - the shared_ptr on the http::context that > would go out of scope when the callback is called. Yeah, I thought about "context" going out of scope just after sending the email. Thanks! -- Barbu Paul - Gheorghe Common sense is not so common - Voltaire Visit My GitHub profile to see my open-source projects - https://github.com/paullik |