------------------------------------------------------------------------------ SetBlocking() ------------------------------------------------------------------------------
| 850 | // |
| 851 | //------------------------------------------------------------------------------ |
| 852 | bool 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 | // |
no outgoing calls
no test coverage detected