mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-15 10:29:47 +00:00
Apply SO_EXCLUSIVEADDRUSE and SO_REUSEADDR on windows
This commit is contained in:
1 parent
717c9dbe89
commit
48333041f4
2 files changed
+4
-2
No files matched your search
+2
-1
@@ -4552,7 +4552,8 @@ bool mg_open_listener(struct mg_connection *c, const char *url) {
|
||||
(char *) &on, sizeof(on))) != 0) {
|
||||
// "Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE"
|
||||
MG_ERROR(("setsockopt(SO_EXCLUSIVEADDRUSE): %d %d", on, MG_SOCK_ERR(rc)));
|
||||
#elif defined(SO_REUSEADDR) && (!defined(LWIP_SOCKET) || SO_REUSE)
|
||||
#endif
|
||||
#if defined(SO_REUSEADDR) && (!defined(LWIP_SOCKET) || SO_REUSE)
|
||||
} else if ((rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &on,
|
||||
sizeof(on))) != 0) {
|
||||
// 1. SO_REUSEADDR semantics on UNIX and Windows is different. On
|
||||
|
||||
+2
-1
@@ -198,7 +198,8 @@ bool mg_open_listener(struct mg_connection *c, const char *url) {
|
||||
(char *) &on, sizeof(on))) != 0) {
|
||||
// "Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE"
|
||||
MG_ERROR(("setsockopt(SO_EXCLUSIVEADDRUSE): %d %d", on, MG_SOCK_ERR(rc)));
|
||||
#elif defined(SO_REUSEADDR) && (!defined(LWIP_SOCKET) || SO_REUSE)
|
||||
#endif
|
||||
#if defined(SO_REUSEADDR) && (!defined(LWIP_SOCKET) || SO_REUSE)
|
||||
} else if ((rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &on,
|
||||
sizeof(on))) != 0) {
|
||||
// 1. SO_REUSEADDR semantics on UNIX and Windows is different. On
|
||||
|
||||
Reference in new issue
Block a user