>> Try to explain what exactly you are trying to do and what behavior do you want.
>
>Im tryin make messaging, like a chat (facebook example) but between only two
>users.
>cppcms json rpc or sse?
>Artyom you can explain how i can make it?
I'd create an instance of asynchronous application that handles all long running
events.
The async app needs to keep multiple queues for different
users and when an ordinary (sync) application handles the rest.
Now when new message arrives you just need to notify an async. app on such
a message and push it to an appropriate queue. Note if you push a message
from sync. app. to async. one you need to pass it via service().post()
to the thread that runs the event loop.
std::string new_message=...,user=...; service().post([=]{
// will be executed in event loop's thread
global_async_app_ptr->handle_new_message_for_user(new_message,user);
});
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>
>
>------------------------------------------------------------------------------
>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>MVPs and experts. ON SALE this month only -- learn more at:
>http://p.sf.net/sfu/learnnow-d2d
>_______________________________________________
>Cppcms-users mailing list
>Cpp...@li...
>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
>
|