Skip to content

Commit

Permalink
Init debug socket for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Altai-man authored and samcv committed Jul 22, 2019
1 parent cfead8e commit 052966b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/debug/debugserver.c
Expand Up @@ -2565,12 +2565,25 @@ static void debugserver_worker(MVMThreadContext *tc, MVMCallsite *callsite, MVMR
vm->debugserver->thread_id = tc->thread_obj->body.thread_id;

{
#ifdef _WIN32
WORD wVersionRequested;
WSADATA wsaData;
#endif
char portstr[16];
struct addrinfo *res;
int error;

snprintf(portstr, 16, "%"PRIu64, port);

#ifdef _WIN32
wVersionRequested = MAKEWORD(2, 2);

error = WSAStartup(wVersionRequested, &wsaData);
if (error != 0) {
MVM_panic(1, "WSAStartup failed with error: %n", error);
}
#endif

getaddrinfo("localhost", portstr, NULL, &res);

listensocket = socket(res->ai_family, SOCK_STREAM, 0);
Expand Down

0 comments on commit 052966b

Please sign in to comment.