MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / _SetNonBlocking

Function _SetNonBlocking

cpp/src/platform/HttpClient.cpp:361–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361static bool _SetNonBlocking
362(
363SOCKET s,
364bool nonblock
365)
366{
367 if(!SOCKETVALID(s))
368 return false;
369#ifdef MINIHTTP_USE_POLARSSL
370 if(nonblock)
371 return net_set_nonblock(s) == 0;
372 else
373 return net_set_block(s) == 0;
374#elif defined(_WIN32)
375 ULONG tmp = !!nonblock;
376 if(::ioctlsocket(s, FIONBIO, &tmp) == SOCKET_ERROR)
377 return false;
378#else
379 int tmp = ::fcntl(s, F_GETFL);
380 if(tmp < 0)
381 return false;
382 if(::fcntl(s, F_SETFL, nonblock ? (tmp|O_NONBLOCK) : (tmp|=~O_NONBLOCK)) < 0)
383 return false;
384#endif
385 return true;
386}
387
388TcpSocket::TcpSocket
389(

Callers 2

SetNonBlockingMethod · 0.85
openMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected