diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-07 16:35:15 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-07 16:35:15 +0200 |
commit | 17623dd6b6d800e15b3a27de4d14fd1a3a160b1b (patch) | |
tree | 9a34766f1bda012f06bf18abcea687c8a4741dd1 /src/DabMux.cpp | |
parent | a951ea2f636360f724ef35e8aabd859e46d42290 (diff) | |
parent | 17e6a246149c11bac667a233fff1a33a1d06a1fb (diff) | |
download | dabmux-17623dd6b6d800e15b3a27de4d14fd1a3a160b1b.tar.gz dabmux-17623dd6b6d800e15b3a27de4d14fd1a3a160b1b.tar.bz2 dabmux-17623dd6b6d800e15b3a27de4d14fd1a3a160b1b.zip |
Merge 'next' into servicelinking
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r-- | src/DabMux.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp index 689b762..aefa701 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -135,8 +135,6 @@ using namespace std; using boost::property_tree::ptree; using boost::property_tree::ptree_error; - - volatile sig_atomic_t running = 1; /* We are not allowed to use etiLog in the signal handler, @@ -275,17 +273,18 @@ int main(int argc, char *argv[]) /************** READ REMOTE CONTROL PARAMETERS *************/ int telnetport = pt.get<int>("remotecontrol.telnetport", 0); - - std::shared_ptr<BaseRemoteController> rc; - if (telnetport != 0) { - rc = std::make_shared<RemoteControllerTelnet>(telnetport); + auto rc = std::make_shared<RemoteControllerTelnet>(telnetport); + rcs.add_controller(rc); } - else { - rc = std::make_shared<RemoteControllerDummy>(); + + auto zmqendpoint = pt.get<string>("remotecontrol.zmqendpoint", ""); + if (not zmqendpoint.empty()) { + auto rc = std::make_shared<RemoteControllerZmq>(zmqendpoint); + rcs.add_controller(rc); } - DabMultiplexer mux(rc, pt); + DabMultiplexer mux(pt); etiLog.level(info) << PACKAGE_NAME << " " << @@ -460,9 +459,8 @@ int main(int argc, char *argv[]) } /* Check every six seconds if the remote control is still working */ - if ((currentFrame % 250 == 249) && rc->fault_detected()) { - etiLog.level(warn) << "Detected Remote Control fault, restarting it"; - rc->restart(); + if (currentFrame % 250 == 249) { + rcs.check_faults(); } /* Same for statistics server */ |