| 295 | } |
| 296 | |
| 297 | std::string receiveString() |
| 298 | { |
| 299 | unsigned int str_size; |
| 300 | receiveData(&str_size, sizeof(unsigned int)); |
| 301 | |
| 302 | if (str_size == 0) |
| 303 | return ""; |
| 304 | |
| 305 | /* TODO: There might be a better way to do this...? */ |
| 306 | std::vector<char> buf(str_size, 0x00); |
| 307 | receiveData(buf.data(), str_size); |
| 308 | |
| 309 | std::string str(buf.data(), str_size); |
| 310 | #ifdef LIBTAS_LIBRARY |
| 311 | LOG(LL_DEBUG, LCF_SOCKET, "Receive socket string %s", str.c_str()); |
| 312 | #endif |
| 313 | return str; |
| 314 | } |
| 315 | |
| 316 | void receiveCString(char* str) |
| 317 | { |
no test coverage detected