| 87 | ssize_t numSentBytes = send(socketFD, message, (strlen(message) + 1), 0); |
| 88 | if(numSentBytes < 0) { |
| 89 | ERROR(1, "Error sending to server."); |
| 90 | } |
| 91 | else if(numSentBytes == 0) { |
| 92 | LOG("socket_comm::SendMessage - Server closed the socket.\n"); |
| 93 | } |
| 94 | |
| 95 | return numSentBytes; |
| 96 | } |
| 97 | */ |
| 98 | |
| 99 | // TODO this function is here to handle calls to send const char* messages. Note |
| 100 | // that the std::string.c_str() function auto-appends a null character at the |
| 101 | // end of the cstring, so the strcat function call in the previous function |
| 102 | // isn't necessary here... I think... although I still don't really understand |
| 103 | // what exactly that call is for. |
| 104 | int32_t |
| 105 | SendMessage(int32_t socketFD, const char* message) |
| 106 | { |