summaryrefslogtreecommitdiffstats
path: root/src/rpc-server/trex_rpc_server.cpp
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-06-07 13:02:08 +0300
committerHanoh Haim <hhaim@cisco.com>2016-06-07 13:02:08 +0300
commit38bcd9c376add0f94e3f660bbcf0558c55f31135 (patch)
treef5d6fd309f7995b94d0558ea4ec29ba00faa1c73 /src/rpc-server/trex_rpc_server.cpp
parent0814f72d66600967c9bf5f1c743ce0ee64e5c1f2 (diff)
parent918ae3cda75a01c8a4769df79bf6bfd0b270a41f (diff)
Merge branch 'master' of csi-sceasr-b94:/auto/proj-pcube-b/apps/PL-b/tools/repo//trex-core
Diffstat (limited to 'src/rpc-server/trex_rpc_server.cpp')
-rw-r--r--src/rpc-server/trex_rpc_server.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/rpc-server/trex_rpc_server.cpp b/src/rpc-server/trex_rpc_server.cpp
index 7d2e31a5..e4ca95c3 100644
--- a/src/rpc-server/trex_rpc_server.cpp
+++ b/src/rpc-server/trex_rpc_server.cpp
@@ -28,11 +28,20 @@ limitations under the License.
#include <sstream>
#include <iostream>
+#include "trex_watchdog.h"
+
/************** RPC server interface ***************/
-TrexRpcServerInterface::TrexRpcServerInterface(const TrexRpcServerConfig &cfg, const std::string &name, std::mutex *lock) : m_cfg(cfg), m_name(name), m_lock(lock) {
+TrexRpcServerInterface::TrexRpcServerInterface(const TrexRpcServerConfig &cfg, const std::string &name) : m_cfg(cfg) {
+ m_name = name;
+
+ m_lock = cfg.m_lock;
+ m_watchdog = cfg.m_watchdog;
+ m_watchdog_handle = -1;
+
m_is_running = false;
m_is_verbose = false;
+
if (m_lock == NULL) {
m_lock = &m_dummy_lock;
}
@@ -69,6 +78,7 @@ void TrexRpcServerInterface::start() {
/* prepare for run */
_prepare();
+ m_watchdog->mark_pending_monitor();
m_thread = new std::thread(&TrexRpcServerInterface::_rpc_thread_cb, this);
if (!m_thread) {
throw TrexRpcException("unable to create RPC thread");
@@ -119,8 +129,7 @@ get_current_date_time() {
const std::string TrexRpcServer::s_server_uptime = get_current_date_time();
-TrexRpcServer::TrexRpcServer(const TrexRpcServerConfig *req_resp_cfg,
- std::mutex *lock) {
+TrexRpcServer::TrexRpcServer(const TrexRpcServerConfig *req_resp_cfg) {
m_req_resp = NULL;
@@ -130,7 +139,7 @@ TrexRpcServer::TrexRpcServer(const TrexRpcServerConfig *req_resp_cfg,
if (req_resp_cfg->get_protocol() == TrexRpcServerConfig::RPC_PROT_MOCK) {
m_req_resp = new TrexRpcServerReqResMock(*req_resp_cfg);
} else {
- m_req_resp = new TrexRpcServerReqRes(*req_resp_cfg, lock);
+ m_req_resp = new TrexRpcServerReqRes(*req_resp_cfg);
}
m_servers.push_back(m_req_resp);