diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-03-06 19:05:01 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-03-06 19:05:01 +0100 |
commit | 0414d5788090bb6df728d370079e44e95b4ffd20 (patch) | |
tree | 4294702d0e38b87f9fa3396a2edd2e2a522c520f /src/DabMux.cpp | |
parent | 43635f1d8a96c9711d7004d9bf6114eedb8e6ccd (diff) | |
download | dabmux-0414d5788090bb6df728d370079e44e95b4ffd20.tar.gz dabmux-0414d5788090bb6df728d370079e44e95b4ffd20.tar.bz2 dabmux-0414d5788090bb6df728d370079e44e95b4ffd20.zip |
Publish ptree on port 8001
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r-- | src/DabMux.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp index d0ec502..950eefe 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -27,6 +27,8 @@ # include "config.h" #endif +#include <boost/property_tree/ptree.hpp> +#include <boost/property_tree/info_parser.hpp> #include <cstdio> #include <stdlib.h> #include <iostream> @@ -124,16 +126,22 @@ typedef DWORD32 uint32_t; #include "MuxElements.h" #include "utils.h" #include "ParserCmdline.h" -#include "ParserConfigfile.h" +#include "ConfigParser.h" #include "StatsServer.h" +#include "ConfigServer.h" #include "Log.h" #include "RemoteControl.h" using namespace std; +using boost::property_tree::ptree; +using boost::property_tree::ptree_error; + /* Global stats server */ StatsServer* global_stats; +ConfigServer config_server(8001); + class MuxInitException : public exception { public: @@ -337,6 +345,8 @@ int main(int argc, char *argv[]) edi_conf.dump = false; edi_conf.enable_pft = false; + ptree pt; + struct timeval mnsc_time; @@ -360,7 +370,9 @@ int main(int argc, char *argv[]) } try { - parse_configfile(conf_file, outputs, ensemble, &enableTist, &FICL, + read_info(conf_file, pt); + + parse_ptree(pt, outputs, ensemble, &enableTist, &FICL, &factumAnalyzer, &limit, &rc, &statsserverport, &edi_conf); } catch (runtime_error &e) { @@ -525,11 +537,10 @@ int main(int argc, char *argv[]) for (output = outputs.begin(); output != outputs.end() ; ++output) { + if (0) { #if defined(HAVE_OUTPUT_FILE) - if ((*output)->outputProto == "file") { + } else if ((*output)->outputProto == "file") { (*output)->output = new DabOutputFile(); -#else // !defined(HAVE_OUTPUT_FILE) - if (0) { #endif // defined(HAVE_OUTPUT_FILE) #if defined(HAVE_OUTPUT_FIFO) } else if ((*output)->outputProto == "fifo") { @@ -2168,6 +2179,17 @@ int main(int argc, char *argv[]) "Detected Statistics Server fault, restarting it"; global_stats->restart(); } + + if (fc->FCT % 10 == 0) { + if (config_server.fault_detected()) { + config_server.restart(); + } + + if (config_server.request_pending()) { + config_server.update_ptree(pt); + } + + } } } |