summaryrefslogtreecommitdiffstats
path: root/src/main_server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main_server.cpp')
-rw-r--r--src/main_server.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main_server.cpp b/src/main_server.cpp
index cd84cb9..b2f9425 100644
--- a/src/main_server.cpp
+++ b/src/main_server.cpp
@@ -10,11 +10,14 @@
#include <thread>
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);
}
void start(std::function<void(void)> func){
@@ -30,12 +33,14 @@ int main (int argc, char *argv[]){
initLog();
- if(argc < 2){
- BOOST_LOG_TRIVIAL(error) << "Program usage: ./onlineDetectorSimulatorServer <address>!";
+ if(argc < 4){
+ BOOST_LOG_TRIVIAL(error) << "Program usage: ./onlineDetectorSimulatorServer <address> <first_port> <num_ports>";
return 0;
}
std::string address = argv[1];
+ int firstPort = std::stoi(argv[2]);
+ int numPorts = std::stoi(argv[3]);
// int port = 4002;
//
@@ -46,9 +51,8 @@ int main (int argc, char *argv[]){
std::vector<unsigned short> buf(16000);
- std::cout << "Receiving UDP packages: " << std::endl;
-
- ReceiverThreads(address, 10, 27);
+ printf("Receving udp packets on ports %u - %u\n", firstPort, firstPort + numPorts);
+ ReceiverThreads(address, 10, numPorts, firstPort);
// for(auto i = 0; i < 27; i++){
// std::function<void(void)> f = [=]() {