mirror of
https://github.com/modelec/estimation_points.git
synced 2026-01-18 16:47:40 +01:00
32 lines
587 B
C++
32 lines
587 B
C++
#include <atomic>
|
|
#include <iostream>
|
|
#include "tcp/MyClient.h"
|
|
|
|
std::atomic<bool> stopRequested(false);
|
|
|
|
void userInputThread() {
|
|
// Wait for the user to press Enter
|
|
std::cout << "Press Enter to stop the program..." << std::endl;
|
|
std::cin.ignore();
|
|
stopRequested = true;
|
|
}
|
|
|
|
int main() {
|
|
MyClient client("127.0.0.1", 8080);
|
|
|
|
client.start();
|
|
|
|
client.sendMessage("point;start;ready;1");
|
|
|
|
std::thread inputThread(userInputThread);
|
|
|
|
while (true) {
|
|
if(stopRequested) {
|
|
break;
|
|
}
|
|
usleep(1'000'000);
|
|
}
|
|
|
|
return 0;
|
|
}
|