Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ((message_size = static_cast<size_t>(recv(socket, read_buffer, sizeof(read_buffer), 0))) > 0) {
- cout << "[Server] Client message accepted" << endl;
- cout << "[Server] Client message: " << endl << read_buffer << endl;
- //string converted_message_for_send = convert_client_message(read_buffer);
- // if (send(socket, converted_message_for_send.c_str(), converted_message_for_send.size(), 0) == -1) {
- // cout << "[Server] Message send failure" << endl;
- // }
- // if (write(socket, read_buffer, message_size) == -1) {
- // cout << "[Client] Message sending failed" << endl;
- // return;
- // }
- cout << "[Server] Message sent to client" << endl << endl;
- cout << "============================" << endl << endl;
- memset(&read_buffer, 0, 128000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement