Gracefull down of c++ standart version
Add stress-test shell script
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user