MCPcopy Create free account
hub / github.com/clementgallet/libTAS / receiveMessageNonBlocking

Function receiveMessageNonBlocking

src/shared/sockethelpers.cpp:280–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280int 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
297std::string receiveString()
298{

Callers 1

receive_messagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected