mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Outbound message re architecture (#116)
* Removing const keyword from send function definition in comm_session class. * Rearchitecture outgoing messages. * Removed concurrentqueue.h file out of the project. * Updated ReadMe file. * Minor comment reformattings. * Readme update with concurrent queue github link. * Removed should_stop_messaging_threads variable. * Updated ReadMe file * Updated and Changed the formatting of the Blake3 build script in ReadMe. * Resolved review comment. Co-authored-by: Savinda Senevirathne <savindadilsara@gmail.com>
This commit is contained in:
@@ -157,6 +157,10 @@ namespace comm
|
||||
{
|
||||
std::scoped_lock<std::mutex> lock(sessions_mutex);
|
||||
const auto [itr, success] = sessions.try_emplace(client_fd, std::move(session));
|
||||
|
||||
// Thread is seperately started after the moving operation to overcome the difficulty
|
||||
// in accessing class member variables inside the thread.
|
||||
// Class member variables gives unacceptable values if the thread starts before the move operation.
|
||||
itr->second.start_messaging_threads();
|
||||
}
|
||||
}
|
||||
@@ -209,6 +213,9 @@ namespace comm
|
||||
{
|
||||
std::scoped_lock<std::mutex> lock(sessions_mutex);
|
||||
const auto [itr, success] = sessions.try_emplace(client.read_fd, std::move(session));
|
||||
// Thread is seperately started after the moving operation to overcome the difficulty
|
||||
// in accessing class member variables inside the thread.
|
||||
// Class member variables gives unacceptable values if the thread starts before the move operation.
|
||||
itr->second.start_messaging_threads();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user