From b5fa7569f26dabb049d6862281c87e2c3cb4def8 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 31 Mar 2020 17:54:54 +0200 Subject: [PATCH] apilistener: Make SO_REUSEPORT optional --- lib/remote/apilistener.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index cb024e1fd..b5f175df0 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -275,7 +275,7 @@ void ApiListener::Start(bool runtimeCreated) /* Keep this in relative sync with the cold startup in UpdateObjectAuthority() and the reconnect interval above. * Previous: 60s reconnect, 30s OA, 60s cold startup. - * Now: 10s reconnect, 10s OA, 30s cold startup. + * Now: 10s reconnect, 10s OA, 30s cold startup. */ m_AuthorityTimer = new Timer(); m_AuthorityTimer->OnTimerExpired.connect(std::bind(&ApiListener::UpdateObjectAuthority)); @@ -386,9 +386,9 @@ bool ApiListener::AddListener(const String& node, const String& service) const int optTrue = 1; setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast(&optTrue), sizeof(optTrue)); -#ifndef _WIN32 +#ifdef SO_REUSEPORT setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, reinterpret_cast(&optTrue), sizeof(optTrue)); -#endif /* _WIN32 */ +#endif /* SO_REUSEPORT */ } acceptor->bind(current->endpoint());