diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-07-13 03:01:05 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-07-13 03:01:05 -0700 |
| commit | 4735d7b69aaf0109b49a6a152b50099ad8400f96 (patch) | |
| tree | 226a34bca67f908e0e70a1ecc858015b4538df06 /src/platform/windows/win_thread.c | |
| parent | 85593e678c35c13ed2d37f7f22aa41b0b8d70825 (diff) | |
| download | nng-4735d7b69aaf0109b49a6a152b50099ad8400f96.tar.gz nng-4735d7b69aaf0109b49a6a152b50099ad8400f96.tar.bz2 nng-4735d7b69aaf0109b49a6a152b50099ad8400f96.zip | |
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.
Diffstat (limited to 'src/platform/windows/win_thread.c')
| -rw-r--r-- | src/platform/windows/win_thread.c | 19 |
1 files changed, 6 insertions, 13 deletions
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(); } |
