aboutsummaryrefslogtreecommitdiff
path: root/src/platform/windows/win_debug.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-07-11 22:59:38 -0700
committerGarrett D'Amore <garrett@damore.org>2017-07-11 22:59:38 -0700
commit8741c4421ec7a5e889c05a3d7dd46feee93ddf9a (patch)
tree9024d46ff202b065c67c2ea75ee5e43417ce4cdb /src/platform/windows/win_debug.c
parent183bd7e02c81bc09c17c6f4c0d3883d4d45221fc (diff)
downloadnng-8741c4421ec7a5e889c05a3d7dd46feee93ddf9a.tar.gz
nng-8741c4421ec7a5e889c05a3d7dd46feee93ddf9a.tar.bz2
nng-8741c4421ec7a5e889c05a3d7dd46feee93ddf9a.zip
Windows IPC working, mostly.
The IOCP code has been refactored to improve reuse, and hopefully will be easier to use with TCP now. Windows IPC using Named Pipes is mostly working -- mostly because there is a gnarly close-race. It seems that we need to take some more care to ensure that the pipe is not released while requests may be outstanding -- so some deeper synchronization between the IOCP callback logic and the win_event code is needed. In short, we need to add a condvar to the event, and notice when we have submitted work for async completion, and make sure we flag the event "idle" after either completion or cancellation of the event.
Diffstat (limited to 'src/platform/windows/win_debug.c')
-rw-r--r--src/platform/windows/win_debug.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/platform/windows/win_debug.c b/src/platform/windows/win_debug.c
index bc3d5bfa..cc2adb88 100644
--- a/src/platform/windows/win_debug.c
+++ b/src/platform/windows/win_debug.c
@@ -42,11 +42,20 @@ static struct {
int sys_err;
int nng_err;
} nni_plat_errnos[] = {
- { ENOENT, NNG_ENOENT }, { EINTR, NNG_EINTR }, { EINVAL, NNG_EINVAL },
- { ENOMEM, NNG_ENOMEM }, { EACCES, NNG_EPERM }, { EAGAIN, NNG_EAGAIN },
- { EBADF, NNG_ECLOSED }, { EBUSY, NNG_EBUSY },
- { ENAMETOOLONG, NNG_EINVAL }, { EPERM, NNG_EPERM },
- { EPIPE, NNG_ECLOSED }, { 0, 0 } // must be last
+ // clang-format off
+ { ENOENT, NNG_ENOENT },
+ { EINTR, NNG_EINTR },
+ { EINVAL, NNG_EINVAL },
+ { ENOMEM, NNG_ENOMEM },
+ { EACCES, NNG_EPERM },
+ { EAGAIN, NNG_EAGAIN },
+ { EBADF, NNG_ECLOSED },
+ { EBUSY, NNG_EBUSY },
+ { ENAMETOOLONG, NNG_EINVAL },
+ { EPERM, NNG_EPERM },
+ { EPIPE, NNG_ECLOSED },
+ { 0, 0 } // must be last
+ // clang-format on
};
int
@@ -107,7 +116,7 @@ nni_win_error(int errnum)
if (errnum == 0) {
return (0);
}
- for (i = 0; nni_win_errnos[i].nng_err != 0; i++) {
+ for (i = 0; nni_win_errnos[i].win_err != 0; i++) {
if (errnum == nni_win_errnos[i].win_err) {
return (nni_win_errnos[i].nng_err);
}