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_debug.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_debug.c')
| -rw-r--r-- | src/platform/windows/win_debug.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/platform/windows/win_debug.c b/src/platform/windows/win_debug.c index cc2adb88..cbf0a61c 100644 --- a/src/platform/windows/win_debug.c +++ b/src/platform/windows/win_debug.c @@ -77,7 +77,9 @@ nni_plat_errno(int errnum) // Windows has infinite numbers of error codes it seems. We only bother // with the ones that are relevant to us (we think). Note that there is -// no overlap between errnos and GetLastError values. +// no overlap between errnos and GetLastError values. Note also that +// the WinSock errors are basically in the same number space as other +// errors, and WSAGetLastError() is an alias for GetLastError(). static struct { int win_err; int nng_err; @@ -101,6 +103,37 @@ static struct { { ERROR_PIPE_NOT_CONNECTED, NNG_ECLOSED }, { ERROR_OPERATION_ABORTED, NNG_ECLOSED }, { WAIT_TIMEOUT, NNG_ETIMEDOUT }, + { WSAEINTR, NNG_EINTR }, + { WSAEBADF, NNG_ECLOSED }, + { WSAEACCES, NNG_EPERM }, + { WSAEWOULDBLOCK, NNG_EAGAIN }, + { WSAEINPROGRESS, NNG_EAGAIN }, + { WSAENOTSOCK, NNG_ECLOSED }, + { WSAEMSGSIZE, NNG_EMSGSIZE }, + { WSAENOPROTOOPT, NNG_ENOTSUP }, + { WSAEPROTONOSUPPORT, NNG_ENOTSUP }, + { WSAEPROTONOSUPPORT, NNG_ENOTSUP }, + { WSAEADDRINUSE, NNG_EADDRINUSE }, + { WSAEADDRNOTAVAIL, NNG_EADDRINVAL }, + { WSAENETDOWN, NNG_EUNREACHABLE }, + { WSAENETUNREACH, NNG_EUNREACHABLE }, + { WSAECONNABORTED, NNG_ETIMEDOUT }, + { WSAECONNRESET, NNG_ECLOSED }, + { WSAENOBUFS, NNG_ENOMEM }, + { WSAENOTCONN, NNG_ECLOSED }, + { WSAESHUTDOWN, NNG_ECLOSED }, + { WSAETIMEDOUT, NNG_ETIMEDOUT }, + { WSAECONNREFUSED, NNG_ECONNREFUSED }, + { WSAEHOSTDOWN, NNG_EUNREACHABLE }, + { WSAEHOSTUNREACH, NNG_EUNREACHABLE }, + { WSAVERNOTSUPPORTED, NNG_ENOTSUP }, + { WSAEDISCON, NNG_ECLOSED }, + { WSAECANCELLED, NNG_ECANCELED }, + { WSA_E_CANCELLED, NNG_ECANCELED }, + { WSAHOST_NOT_FOUND, NNG_EADDRINVAL }, + { WSATRY_AGAIN, NNG_EAGAIN }, + { WSANO_DATA, NNG_EADDRINVAL }, + // Must be Last!! { 0, 0 }, // clang-format on |
