diff options
author | 2015-10-22 05:31:22 +0300 | |
---|---|---|
committer | 2015-10-22 05:31:22 +0300 | |
commit | f5c4a8051d697c086eb0d1c8ce3ac90ab245d249 (patch) | |
tree | fb0d379947c4b1984b77f6594d27f96d72c3cba0 /src/rpc-server/trex_rpc_server.cpp | |
parent | 508703e11a3fad3e44535c5433f803d77f28e245 (diff) | |
parent | 876c76572fdb2fb8f0e8db21bc420d284dc05950 (diff) |
Merge branch 'master' into dan_stateless
Diffstat (limited to 'src/rpc-server/trex_rpc_server.cpp')
-rw-r--r-- | src/rpc-server/trex_rpc_server.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/rpc-server/trex_rpc_server.cpp b/src/rpc-server/trex_rpc_server.cpp index 6b8c200d..a14e6f97 100644 --- a/src/rpc-server/trex_rpc_server.cpp +++ b/src/rpc-server/trex_rpc_server.cpp @@ -21,6 +21,7 @@ limitations under the License. #include <trex_rpc_server_api.h> #include <trex_rpc_req_resp_server.h> +#include <trex_rpc_async_server.h> #include <trex_rpc_jsonrpc_v2_parser.h> #include <unistd.h> #include <zmq.h> @@ -29,7 +30,7 @@ limitations under the License. /************** RPC server interface ***************/ -TrexRpcServerInterface::TrexRpcServerInterface(const TrexRpcServerConfig &cfg, const std::string &name) : m_cfg(cfg), m_name(name) { +TrexRpcServerInterface::TrexRpcServerInterface(const TrexRpcServerConfig &cfg, const std::string &name, std::mutex *lock) : m_cfg(cfg), m_name(name), m_lock(lock) { m_is_running = false; m_is_verbose = false; } @@ -112,10 +113,19 @@ get_current_date_time() { const std::string TrexRpcServer::s_server_uptime = get_current_date_time(); -TrexRpcServer::TrexRpcServer(const TrexRpcServerConfig &req_resp_cfg) { +TrexRpcServer::TrexRpcServer(const TrexRpcServerConfig *req_resp_cfg, + const TrexRpcServerConfig *async_cfg, + std::mutex *lock) { /* add the request response server */ - m_servers.push_back(new TrexRpcServerReqRes(req_resp_cfg)); + if (req_resp_cfg) { + m_servers.push_back(new TrexRpcServerReqRes(*req_resp_cfg, lock)); + } + + /* add async publisher */ + if (async_cfg) { + m_servers.push_back(new TrexRpcServerAsync(*async_cfg, lock)); + } } TrexRpcServer::~TrexRpcServer() { |