MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / SetBlocking

Method SetBlocking

examples/ThirdPartyLibs/clsocket/src/SimpleSocket.cpp:852–881  ·  view source on GitHub ↗

------------------------------------------------------------------------------ SetBlocking() ------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

850//
851//------------------------------------------------------------------------------
852bool CSimpleSocket::SetBlocking(void)
853{
854 int32 nCurFlags;
855
856#if WIN32
857 nCurFlags = 0;
858
859 if (ioctlsocket(m_socket, FIONBIO, (ULONG *)&nCurFlags) != 0)
860 {
861 return false;
862 }
863#else
864 if ((nCurFlags = fcntl(m_socket, F_GETFL)) < 0)
865 {
866 TranslateSocketError();
867 return false;
868 }
869
870 nCurFlags &= (~O_NONBLOCK);
871
872 if (fcntl(m_socket, F_SETFL, nCurFlags) != 0)
873 {
874 TranslateSocketError();
875 return false;
876 }
877#endif
878 m_bIsBlocking = true;
879
880 return true;
881}
882
883//------------------------------------------------------------------------------
884//

Callers 2

connectMethod · 0.80
TCPThreadFuncFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected