Used blocking recv here, to ensure that we wait for the server to respond

This commit is contained in:
2024-03-12 10:02:53 -05:00
parent a847da5339
commit 94e08f3863

View File

@@ -108,7 +108,7 @@ GameType check_server_client(int argc, char** argv) {
client->create_socket();
/* Send a specific message to the server, and wait for the appropriate response, to know that the server is ready */
client->sendAll("GG");
std::string msg_from_server = client->recvAllNB();
std::string msg_from_server = client->recvAll();
if (msg_from_server == "U2") {
std::cout << "Connection made. Waiting for server to begin game..." << std::endl;
} else {