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

master
Aadhavan Srinivasan 7 months ago
parent a847da5339
commit 94e08f3863

@ -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 {

Loading…
Cancel
Save