Advertisement
TwITe

Untitled

Jan 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1.         while ((message_size = static_cast<size_t>(recv(socket, read_buffer, sizeof(read_buffer), 0))) > 0) {
  2.             cout << "[Server] Client message accepted" << endl;
  3.             cout << "[Server] Client message: " << endl << read_buffer << endl;
  4.  
  5.             //string converted_message_for_send = convert_client_message(read_buffer);
  6.  
  7. //            if (send(socket, converted_message_for_send.c_str(), converted_message_for_send.size(), 0) == -1) {
  8. //                cout << "[Server] Message send failure" << endl;
  9. //            }
  10.  
  11. //            if (write(socket, read_buffer, message_size) == -1) {
  12. //                cout << "[Client] Message sending failed" << endl;
  13. //                return;
  14. //            }
  15.             cout << "[Server] Message sent to client" << endl << endl;
  16.             cout << "============================" << endl << endl;
  17.  
  18.             memset(&read_buffer, 0, 128000);
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement