diff --git a/sources/main.c b/sources/main.c index 30daa45fac4f2cbd8def52f536bc6e43fb85c7c7..3b5eb06dddb23a7d9af598ca34bb94ee7bf3f095 100755 --- a/sources/main.c +++ b/sources/main.c @@ -206,6 +206,15 @@ int main( int argc, const char **argv ) #endif } +#ifdef __WIN32 + WSADATA wsaData; + int ret = WSAStartup(MAKEWORD(2, 2), &wsaData); + if (ret != 0) { + log_it(L_CRITICAL, "Couldn't init Winsock DLL, error: %d", ret); + return -2; + } +#endif + if ( dap_server_init(l_thread_cnt) != 0 ) { log_it( L_CRITICAL, "Can't init socket server module" ); return -4; @@ -420,6 +429,9 @@ int main( int argc, const char **argv ) // Deinit modules failure: +#ifdef __WIN32 + WSACleanup(); +#endif dap_stream_deinit(); dap_stream_ctl_deinit();