From 4735d7b69aaf0109b49a6a152b50099ad8400f96 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 13 Jul 2017 03:01:05 -0700 Subject: Windows implmentation of TCP is "working now". This is only lightly tested, and I expect that there remain some race conditions. Endpoint logic in particular needs work. --- src/platform/windows/win_thread.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src/platform/windows/win_thread.c') diff --git a/src/platform/windows/win_thread.c b/src/platform/windows/win_thread.c index 693516bd..0859b4a4 100644 --- a/src/platform/windows/win_thread.c +++ b/src/platform/windows/win_thread.c @@ -148,24 +148,16 @@ nni_plat_init(int (*helper)(void)) AcquireSRWLockExclusive(&lock); if (!inited) { - WSADATA data; - WORD ver; - ver = MAKEWORD(2, 2); - if (WSAStartup(MAKEWORD(2, 2), &data) != 0) { - if ((LOBYTE(data.wVersion) != 2) || - (HIBYTE(data.wVersion) != 2)) { - nni_panic("got back wrong winsock ver"); - } - rv = NNG_EINVAL; + if ((rv = nni_win_iocp_sysinit()) != 0) { goto out; } - if ((rv = nni_win_iocp_sysinit()) != 0) { + if ((rv = nni_win_ipc_sysinit()) != 0) { goto out; } - if ((rv = nni_win_resolv_sysinit()) != 0) { + if ((rv = nni_win_tcp_sysinit()) != 0) { goto out; } - if ((rv = nni_win_ipc_sysinit()) != 0) { + if ((rv = nni_win_resolv_sysinit()) != 0) { goto out; } @@ -182,8 +174,9 @@ out: void nni_plat_fini(void) { - nni_win_ipc_sysfini(); nni_win_resolv_sysfini(); + nni_win_ipc_sysfini(); + nni_win_tcp_sysfini(); nni_win_iocp_sysfini(); WSACleanup(); } -- cgit v1.2.3-70-g09d2