From 254f1dc9e629e9de818672174a6614c6595fb11a Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 6 Aug 2018 20:20:46 +0200 Subject: Support arbitrary ports and port-range splitting --- src/main_client.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/main_client.cpp') 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 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
!"; + if(argc < 5){ + BOOST_LOG_TRIVIAL(error) << "Program usage: ./onlineDetectorSimulatorClient
"; 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); -- cgit v1.2.3