Skip to content

Commit

Permalink
- Socket(Windows): make sure that WSAStartup is only called once (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzillgith committed Dec 27, 2024
1 parent 3c493ad commit fade6da
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib60870-C/src/hal/socket/win32/socket_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,9 @@ Socket_connectAsync(Socket self, const char* address, int port)
printf("WIN32_SOCKET: Socket_connect: %s:%i\n", address, port);

struct sockaddr_in serverAddress;
WSADATA wsa;
int ec;

if ((ec = WSAStartup(MAKEWORD(2,0), &wsa)) != 0) {
if (DEBUG_SOCKET)
printf("WIN32_SOCKET: winsock error: code %i\n", ec);
if (wsaStartUp() == false)
return false;
}

if (!prepareAddress(address, port, &serverAddress))
return false;
Expand Down

0 comments on commit fade6da

Please sign in to comment.