diff --git a/source/os/src/osSocket.c b/source/os/src/osSocket.c index 14fb4562ea..572edf76fd 100644 --- a/source/os/src/osSocket.c +++ b/source/os/src/osSocket.c @@ -223,20 +223,6 @@ int32_t taosShutDownSocketServerRDWR(TdSocketServerPtr pSocketServer) { #endif } -void taosWinSocketInit() { -#ifdef WINDOWS - static char flag = 0; - if (flag == 0) { - WORD wVersionRequested; - WSADATA wsaData; - wVersionRequested = MAKEWORD(1, 1); - if (WSAStartup(wVersionRequested, &wsaData) == 0) { - flag = 1; - } - } -#else -#endif -} int32_t taosSetNonblocking(TdSocketPtr pSocket, int32_t on) { if (pSocket == NULL || pSocket->fd < 0) { return -1; @@ -1096,3 +1082,18 @@ int32_t taosCreateSocketWithTimeout(uint32_t timeout) { #endif return (int)fd; } + +void taosWinSocketInit() { +#ifdef WINDOWS + static char flag = 0; + if (flag == 0) { + WORD wVersionRequested; + WSADATA wsaData; + wVersionRequested = MAKEWORD(1, 1); + if (WSAStartup(wVersionRequested, &wsaData) == 0) { + flag = 1; + } + } +#else +#endif +}