summaryrefslogtreecommitdiffstats
path: root/src/ManagementServer.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-19 11:52:39 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-19 11:53:39 +0100
commit039f82969aff73749ff50e9d65950a85509fde0c (patch)
tree25709b273d3af7b47201c40514ab3ef54dd29477 /src/ManagementServer.h
parenta48f80b33a9859da52dfbcebf0bc69e80c1bb8e5 (diff)
downloaddabmux-039f82969aff73749ff50e9d65950a85509fde0c.tar.gz
dabmux-039f82969aff73749ff50e9d65950a85509fde0c.tar.bz2
dabmux-039f82969aff73749ff50e9d65950a85509fde0c.zip
ManagementServer: Use zmq poller instead of nonblock and usleep
Diffstat (limited to 'src/ManagementServer.h')
-rw-r--r--src/ManagementServer.h25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/ManagementServer.h b/src/ManagementServer.h
index f8d722e..c0b50e7 100644
--- a/src/ManagementServer.h
+++ b/src/ManagementServer.h
@@ -135,29 +135,12 @@ class InputStat
class ManagementServer
{
public:
- ManagementServer() :
- m_zmq_context(),
- m_zmq_sock(m_zmq_context, ZMQ_REP),
- m_running(false),
- m_fault(false) { }
-
- ~ManagementServer()
- {
- m_running = false;
- m_fault = false;
- m_thread.join();
- }
-
+ ManagementServer();
ManagementServer(const ManagementServer& other) = delete;
ManagementServer& operator=(const ManagementServer& other) = delete;
+ ~ManagementServer();
- void open(int listenport)
- {
- m_listenport = listenport;
- if (m_listenport > 0) {
- m_thread = std::thread(&ManagementServer::serverThread, this);
- }
- }
+ void open(int listenport);
/* Un-/Register a statistics data source */
void registerInput(InputStat* is);
@@ -174,7 +157,7 @@ class ManagementServer
*/
void update_ptree(const boost::property_tree::ptree& pt);
- bool fault_detected() { return m_fault; }
+ bool fault_detected() const { return m_fault; }
void restart(void);
private: