diff options
author | 2016-03-03 17:14:28 +0200 | |
---|---|---|
committer | 2016-03-03 17:14:28 +0200 | |
commit | 0a10805acc189a36eecb4d49b858bd911bc45f4e (patch) | |
tree | 05ab3e32da5a284c50b2b186be2a7857bb364382 /src/rpc-server/trex_rpc_req_resp_server.cpp | |
parent | 951a503356fd359407a8fae791b75fa8881dc04c (diff) | |
parent | 2760d0eef3076580f3d112c2e754e108f6028dc7 (diff) |
Merge Console merge
Diffstat (limited to 'src/rpc-server/trex_rpc_req_resp_server.cpp')
-rw-r--r-- | src/rpc-server/trex_rpc_req_resp_server.cpp | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/src/rpc-server/trex_rpc_req_resp_server.cpp b/src/rpc-server/trex_rpc_req_resp_server.cpp index da7e8c55..5c587e0f 100644 --- a/src/rpc-server/trex_rpc_req_resp_server.cpp +++ b/src/rpc-server/trex_rpc_req_resp_server.cpp @@ -173,10 +173,8 @@ void TrexRpcServerReqRes::process_request_raw(const std::string &request, std::s int index = 0; - /* if lock was provided, take it */ - if (m_lock) { - m_lock->lock(); - } + /* expcetion safe */ + std::unique_lock<std::mutex> lock(*m_lock); /* for every command parsed - launch it */ for (auto command : commands) { @@ -190,9 +188,7 @@ void TrexRpcServerReqRes::process_request_raw(const std::string &request, std::s } /* done with the lock */ - if (m_lock) { - m_lock->unlock(); - } + lock.unlock(); /* write the JSON to string and sever on ZMQ */ @@ -254,28 +250,3 @@ TrexRpcServerReqRes::test_inject_request(const std::string &req) { return response; } - -/** - * MOCK req resp server - */ -TrexRpcServerReqResMock::TrexRpcServerReqResMock(const TrexRpcServerConfig &cfg) : TrexRpcServerReqRes(cfg) { -} - -/** - * override start - * - */ -void -TrexRpcServerReqResMock::start() { - -} - - -/** - * override stop - */ -void -TrexRpcServerReqResMock::stop() { - -} - |