mirror of
https://github.com/cesanta/mongoose.git
synced 2025-07-31 01:46:16 +08:00
Apply SO_EXCLUSIVEADDRUSE and SO_REUSEADDR on windows
This commit is contained in:
parent
717c9dbe89
commit
48333041f4
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user