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:
priyadharsun
2020-09-11 12:26:16 +05:30
committed by GitHub
parent 3c231727e5
commit 9cc5d46792
10 changed files with 107 additions and 39 deletions

View File

@@ -203,7 +203,7 @@ namespace usr
/**
* Send the specified contract input status result via the provided session.
*/
void send_input_status(const msg::usrmsg::usrmsg_parser &parser, const comm::comm_session &session,
void send_input_status(const msg::usrmsg::usrmsg_parser &parser, comm::comm_session &session,
std::string_view status, std::string_view reason, std::string_view input_sig)
{
std::vector<uint8_t> msg;
@@ -220,7 +220,7 @@ namespace usr
* @param protocol Messaging protocol used by user.
* @return 0 on successful additions. -1 on failure.
*/
int add_user(const comm::comm_session &session, const std::string &pubkey, const util::PROTOCOL protocol)
int add_user(comm::comm_session &session, const std::string &pubkey, const util::PROTOCOL protocol)
{
const std::string &sessionid = session.uniqueid;
if (ctx.users.count(sessionid) == 1)
@@ -269,11 +269,11 @@ namespace usr
}
/**
* Finds and returns the socket session for the proided user pubkey.
* @param pubkey User binary pubkey.
* @return Pointer to the socket session. NULL of not found.
*/
const comm::comm_session *get_session_by_pubkey(const std::string &pubkey)
* Finds and returns the socket session for the proided user pubkey.
* @param pubkey User binary pubkey.
* @return Pointer to the socket session. NULL of not found.
*/
comm::comm_session *get_session_by_pubkey(const std::string &pubkey)
{
const auto sessionid_itr = ctx.sessionids.find(pubkey);
if (sessionid_itr != ctx.sessionids.end())