Fix #1550 - excladdrinuse

This commit is contained in:
Sergey Lyubka 2022-05-21 16:18:34 +01:00
parent ef563603a9
commit d5993ba27e
2 changed files with 2 additions and 2 deletions

View File

@ -4155,7 +4155,7 @@ bool mg_open_listener(struct mg_connection *c, const char *url) {
// but won't work! (setsockopt will return EINVAL)
MG_ERROR(("reuseaddr: %d", MG_SOCK_ERRNO));
#endif
#if MG_ARCH == MG_ARCH_WIN32 && defined(SO_EXCLUSIVEADDRUSE) && !defined(WINCE)
#if MG_ARCH == MG_ARCH_WIN32 && !defined(SO_EXCLUSIVEADDRUSE) && !defined(WINCE)
} else if (setsockopt(fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *) &on,
sizeof(on)) != 0) {
// "Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE"

View File

@ -237,7 +237,7 @@ bool mg_open_listener(struct mg_connection *c, const char *url) {
// but won't work! (setsockopt will return EINVAL)
MG_ERROR(("reuseaddr: %d", MG_SOCK_ERRNO));
#endif
#if MG_ARCH == MG_ARCH_WIN32 && defined(SO_EXCLUSIVEADDRUSE) && !defined(WINCE)
#if MG_ARCH == MG_ARCH_WIN32 && !defined(SO_EXCLUSIVEADDRUSE) && !defined(WINCE)
} else if (setsockopt(fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *) &on,
sizeof(on)) != 0) {
// "Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE"