diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2018-08-06 20:20:46 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2018-08-06 20:20:46 +0200 |
commit | 254f1dc9e629e9de818672174a6614c6595fb11a (patch) | |
tree | 39786da7f579f3098c5a79fe9c129dae2fd3ef5c /src/DetectorModule | |
parent | 7ae5d89c48bd3982626afe03891eab2e2d31e746 (diff) | |
download | ods-254f1dc9e629e9de818672174a6614c6595fb11a.tar.gz ods-254f1dc9e629e9de818672174a6614c6595fb11a.tar.bz2 ods-254f1dc9e629e9de818672174a6614c6595fb11a.tar.xz ods-254f1dc9e629e9de818672174a6614c6595fb11a.zip |
Support arbitrary ports and port-range splitting
Diffstat (limited to 'src/DetectorModule')
-rw-r--r-- | src/DetectorModule/DetectorModule.cpp | 6 | ||||
-rw-r--r-- | src/DetectorModule/DetectorModule.h | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/DetectorModule/DetectorModule.cpp b/src/DetectorModule/DetectorModule.cpp index e7e0272..6767eb9 100644 --- a/src/DetectorModule/DetectorModule.cpp +++ b/src/DetectorModule/DetectorModule.cpp @@ -40,15 +40,13 @@ void timer_start(std::function<void(int)> func, unsigned int interval, unsigned }).detach(); } -DetectorModule::DetectorModule(const int detectorID, const std::string& address, const std::string& configPath) : +DetectorModule::DetectorModule(const int detectorID, const std::string& address, const int port, const std::string& configPath) : detectorID_{detectorID}, numberOfDetectorsPerModule_{16}, index_{0u}, - client_{address, detectorID+4000}, + client_{address, port}, max_packets_{1000u}{ - printf("Creating %d\n", detectorID); - if (readConfig(configPath)) { throw std::runtime_error("DetectorModule: Configuration file could not be loaded successfully. Please check!"); } diff --git a/src/DetectorModule/DetectorModule.h b/src/DetectorModule/DetectorModule.h index f959857..fe25727 100644 --- a/src/DetectorModule/DetectorModule.h +++ b/src/DetectorModule/DetectorModule.h @@ -21,7 +21,7 @@ class DetectorModule { public: - DetectorModule(const int detectorID, const std::string& address, const std::string& configPath); + DetectorModule(const int detectorID, const std::string& address, const int port, const std::string& configPath); auto sendPeriodically(unsigned int timeIntervall) -> void; |