ADD: adden more functionality includeing a tcp server for external comms
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -1,4 +1,4 @@
|
||||
#include "Orders/MoveOrder.hpp"
|
||||
#include <Orders/MoveOrder.hpp>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <csignal>
|
||||
@@ -33,11 +33,10 @@ int main()
|
||||
sigIntHandler.sa_flags = 0;
|
||||
sigaction(SIGINT, &sigIntHandler, NULL);
|
||||
|
||||
const char* CommandPortChar = "31371";
|
||||
const char* CommandPortChar = "5555";
|
||||
if (std::getenv("COMMAND_PORT") != nullptr) {
|
||||
CommandPortChar = std::getenv("COMMAND_PORT");
|
||||
}
|
||||
ushort commandPort_ = (unsigned short)strtol(CommandPortChar,NULL,0);
|
||||
|
||||
|
||||
const char *ServerAddress = nullptr;
|
||||
@@ -49,21 +48,20 @@ int main()
|
||||
|
||||
LOG_S(INFO)<<ServerAddress;
|
||||
|
||||
ushort port = 8000;
|
||||
SimControl::SimControl sc(commandPort_);
|
||||
SimControl::SimControl sc(CommandPortChar);
|
||||
|
||||
|
||||
|
||||
while (running) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||||
sc.stop();
|
||||
|
||||
LOG_S(INFO)<<"end app";
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(300));
|
||||
return 0;
|
||||
std::exit(0);
|
||||
// std::exit(0);
|
||||
}
|
||||
Reference in New Issue
Block a user