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/main_client.cpp | |
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/main_client.cpp')
-rw-r--r-- | src/main_client.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main_client.cpp b/src/main_client.cpp index 01b3aad..fb0c1e3 100644 --- a/src/main_client.cpp +++ b/src/main_client.cpp @@ -10,23 +10,28 @@ #include <string> void initLog() { +/* #ifndef NDEBUG boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::debug); #else boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::info); #endif +*/ + boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::info); } int main (int argc, char *argv[]){ - if(argc < 3){ - BOOST_LOG_TRIVIAL(error) << "Program usage: ./onlineDetectorSimulatorClient <packets_per_second> <address>!"; + if(argc < 5){ + BOOST_LOG_TRIVIAL(error) << "Program usage: ./onlineDetectorSimulatorClient <address> <first_port> <num_ports> <packets_per_second>"; return 0; } - int imagesPerSec = std::stoi(argv[1]); + std::string address = argv[1]; + int firstPort = std::stoi(argv[2]); + int numPorts = std::stoi(argv[3]); + int imagesPerSec = std::stoi(argv[4]); - std::string address = argv[2]; double timegap = 1./(double)imagesPerSec; unsigned int intervall = timegap*1000*1000; @@ -37,7 +42,7 @@ int main (int argc, char *argv[]){ auto configPath = std::string { "config.cfg" }; - Detector detector{address, configPath, intervall}; + Detector detector{address, configPath, firstPort, numPorts, intervall}; //DetectorModule detModule0 = DetectorModule(1, address, configPath); |