mirror of
https://github.com/modelec/TCPSocketServer.git
synced 2026-01-19 00:47:36 +01:00
thread
This commit is contained in:
@@ -126,9 +126,11 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket)
|
||||
if (!gameStarted) return;
|
||||
|
||||
this->stopEmergency = true;
|
||||
this->gameThread.~thread();
|
||||
|
||||
this->broadcastMessage("strat;arduino;clear;1\n");
|
||||
|
||||
this->gameThread.~thread();
|
||||
|
||||
std::vector<std::string> args = TCPUtils::split(tokens[3], ",");
|
||||
|
||||
if (!handleEmergencyFlag) {
|
||||
@@ -794,6 +796,9 @@ void TCPServer::awaitRobotIdle() {
|
||||
usleep(50'000);
|
||||
this->sendToClient("strat;arduino;get state;1\n", this->arduinoSocket);
|
||||
timeout++;
|
||||
if (stopEmergency) {
|
||||
std::terminate();
|
||||
}
|
||||
if (timeout > 80) {
|
||||
this->broadcastMessage("strat;arduino;clear;1");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user