Gracefull down of c++ standart version

Add stress-test shell script
This commit is contained in:
2025-05-01 02:36:10 +03:00
parent 787164f086
commit 12d5ca5d41
4 changed files with 18 additions and 4 deletions

View File

@@ -129,7 +129,7 @@ void Server::handle_client(int client_socket, bool mode, int steps) {
response = "вы проиграли\n";
send(client_socket, response.c_str(), response.size(), 0);
}
shutdown(client_socket, SHUT_RDWR);
close(client_socket);
std::cout << "Игрок " << player_name << " отключился" << std::endl;
}
@@ -155,4 +155,5 @@ void Server::start(int steps, bool service_mode) {
std::cout << "Новое соединение установлено" << std::endl;
std::thread(&Server::handle_client, this, new_socket, service_mode, steps).detach();
}
shutdown(server_socket, SHUT_RDWR);
}