Skip to content
Snippets Groups Projects
Commit 8f6eb4aa authored by Constantin Papizh's avatar Constantin Papizh
Browse files

Winsock init

parent f035026c
No related branches found
No related tags found
1 merge request!15Winsock init
Pipeline #2900 passed with stage
in 1 minute and 43 seconds
...@@ -206,6 +206,15 @@ int main( int argc, const char **argv ) ...@@ -206,6 +206,15 @@ int main( int argc, const char **argv )
#endif #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 ) { if ( dap_server_init(l_thread_cnt) != 0 ) {
log_it( L_CRITICAL, "Can't init socket server module" ); log_it( L_CRITICAL, "Can't init socket server module" );
return -4; return -4;
...@@ -420,6 +429,9 @@ int main( int argc, const char **argv ) ...@@ -420,6 +429,9 @@ int main( int argc, const char **argv )
// Deinit modules // Deinit modules
failure: failure:
#ifdef __WIN32
WSACleanup();
#endif
dap_stream_deinit(); dap_stream_deinit();
dap_stream_ctl_deinit(); dap_stream_ctl_deinit();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment