| 57 | { |
| 58 | public: |
| 59 | static bool InitSocket() |
| 60 | { |
| 61 | bool ret = true; |
| 62 | #ifdef ARK_PLATFORM_WIN |
| 63 | static WSADATA g_WSAData; |
| 64 | if (g_WinSockIsInit) |
| 65 | { |
| 66 | return true; |
| 67 | } |
| 68 | |
| 69 | if (WSAStartup(MAKEWORD(2, 2), &g_WSAData) == 0) |
| 70 | { |
| 71 | g_WinSockIsInit = true; |
| 72 | } |
| 73 | else |
| 74 | { |
| 75 | ret = false; |
| 76 | } |
| 77 | #else |
| 78 | signal(SIGPIPE, SIG_IGN); |
| 79 | #endif |
| 80 | |
| 81 | return ret; |
| 82 | } |
| 83 | |
| 84 | static void ShutSocket() |
| 85 | { |
nothing calls this directly
no outgoing calls
no test coverage detected