summaryrefslogtreecommitdiffstats
path: root/src/OSSupport
diff options
context:
space:
mode:
Diffstat (limited to 'src/OSSupport')
-rw-r--r--src/OSSupport/ServerHandleImpl.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/OSSupport/ServerHandleImpl.cpp b/src/OSSupport/ServerHandleImpl.cpp
index a3a08e84f..6f4343b1f 100644
--- a/src/OSSupport/ServerHandleImpl.cpp
+++ b/src/OSSupport/ServerHandleImpl.cpp
@@ -127,14 +127,9 @@ bool cServerHandleImpl::Listen(UInt16 a_Port)
evutil_socket_t MainSock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
// Set reuse flag
- {
- #if defined(_WIN32) || defined(ANDROID_NDK)
- char yes = 1;
- #else
- int yes = 1;
- #endif
- setsockopt(MainSock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int));
- }
+ #if !defined(_WIN32)
+ evutil_make_listen_socket_reuseable(MainSock);
+ #endif
if (!IsValidSocket(MainSock))
{
@@ -215,14 +210,9 @@ bool cServerHandleImpl::Listen(UInt16 a_Port)
evutil_socket_t SecondSock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
// Set reuse flag
- {
- #if defined(_WIN32) || defined(ANDROID_NDK)
- char yes = 1;
- #else
- int yes = 1;
- #endif
- setsockopt(SecondSock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int));
- }
+ #if !defined(_WIN32)
+ evutil_make_listen_socket_reuseable(SecondSock);
+ #endif
if (!IsValidSocket(SecondSock))
{