| 278 | } |
| 279 | |
| 280 | int receiveMessageNonBlocking() |
| 281 | { |
| 282 | int msg; |
| 283 | int ret = recv(socket_fd, &msg, sizeof(int), MSG_WAITALL | MSG_DONTWAIT); |
| 284 | if (ret < 0) |
| 285 | return ret; |
| 286 | #ifdef LIBTAS_LIBRARY |
| 287 | LOG(LL_DEBUG, LCF_SOCKET, "Receive non-blocking socket message %d", msg); |
| 288 | #endif |
| 289 | |
| 290 | /* Handle special case for closed socket */ |
| 291 | if (ret == 0) |
| 292 | return -2; |
| 293 | |
| 294 | return msg; |
| 295 | } |
| 296 | |
| 297 | std::string receiveString() |
| 298 | { |