ADD: adden more functionality includeing a tcp server for external comms

This commit is contained in:
Henry Winkel
2023-08-16 17:06:37 +02:00
parent 115be453ac
commit 79f9c044e7
15 changed files with 1907 additions and 68 deletions

View File

@@ -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);
}