diff options
author | 2016-06-07 13:02:08 +0300 | |
---|---|---|
committer | 2016-06-07 13:02:08 +0300 | |
commit | 38bcd9c376add0f94e3f660bbcf0558c55f31135 (patch) | |
tree | f5d6fd309f7995b94d0558ea4ec29ba00faa1c73 /src/rpc-server/trex_rpc_server_api.h | |
parent | 0814f72d66600967c9bf5f1c743ce0ee64e5c1f2 (diff) | |
parent | 918ae3cda75a01c8a4769df79bf6bfd0b270a41f (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_api.h')
-rw-r--r-- | src/rpc-server/trex_rpc_server_api.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/rpc-server/trex_rpc_server_api.h b/src/rpc-server/trex_rpc_server_api.h index a02b2cc0..3d9837ef 100644 --- a/src/rpc-server/trex_rpc_server_api.h +++ b/src/rpc-server/trex_rpc_server_api.h @@ -33,6 +33,7 @@ limitations under the License. class TrexRpcServerInterface; class TrexRpcServerReqRes; +class TrexWatchDog; /** * defines a configuration of generic RPC server @@ -47,8 +48,11 @@ public: RPC_PROT_MOCK }; - TrexRpcServerConfig(rpc_prot_e protocol, uint16_t port) : m_protocol(protocol), m_port(port) { - + TrexRpcServerConfig(rpc_prot_e protocol, uint16_t port, std::mutex *lock, TrexWatchDog *watchdog) { + m_protocol = protocol; + m_port = port; + m_lock = lock; + m_watchdog = watchdog; } uint16_t get_port() const { @@ -62,6 +66,10 @@ public: private: rpc_prot_e m_protocol; uint16_t m_port; + +public: + std::mutex *m_lock; + TrexWatchDog *m_watchdog; }; /** @@ -72,7 +80,7 @@ private: class TrexRpcServerInterface { public: - TrexRpcServerInterface(const TrexRpcServerConfig &cfg, const std::string &name, std::mutex *m_lock = NULL); + TrexRpcServerInterface(const TrexRpcServerConfig &cfg, const std::string &name); virtual ~TrexRpcServerInterface(); /** @@ -134,6 +142,8 @@ protected: std::string m_name; std::mutex *m_lock; std::mutex m_dummy_lock; + TrexWatchDog *m_watchdog; + int m_watchdog_handle; }; /** @@ -147,8 +157,7 @@ class TrexRpcServer { public: /* creates the collection of servers using configurations */ - TrexRpcServer(const TrexRpcServerConfig *req_resp_cfg, - std::mutex *m_lock = NULL); + TrexRpcServer(const TrexRpcServerConfig *req_resp_cfg); ~TrexRpcServer(); |