ADD: added testing of client
This commit is contained in:
18
src/main.cpp
18
src/main.cpp
@@ -1,7 +1,9 @@
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <csignal>
|
||||
|
||||
#include <SimControl/SimControl.hpp>
|
||||
#include <loguru.hpp>
|
||||
|
||||
/// variable for stopping the application
|
||||
bool running = true;
|
||||
@@ -30,14 +32,26 @@ int main()
|
||||
sigIntHandler.sa_flags = 0;
|
||||
sigaction(SIGINT, &sigIntHandler, NULL);
|
||||
|
||||
ushort port = 3500;
|
||||
// SimControl::SimControl sc("127.0.0.1",5557);
|
||||
|
||||
SimControl::SimControl sc("127.0.0.255",8000);
|
||||
|
||||
DirectCommunication::DirectCommunicationClient client(port,"127.0.0.1");
|
||||
|
||||
client.sendMessage("Hello Server");
|
||||
|
||||
while (running) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
client.sendMessage("Hello Server");
|
||||
|
||||
std::string MessageString = client.getLatestMessage();
|
||||
LOG_S(INFO)<<MessageString;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
LOG_S(INFO)<<"end app";
|
||||
std::exit(0);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user