From 7f1c25a73b410e1c57dce8fa1d1f20f293353be4 Mon Sep 17 00:00:00 2001 From: Fred Nicolson Date: Fri, 26 Apr 2019 09:59:57 +0100 Subject: [PATCH] Don't set SO_REUSEADDR on Windows --- src/TcpListener.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TcpListener.cpp b/src/TcpListener.cpp index adc5257..c8db2e2 100644 --- a/src/TcpListener.cpp +++ b/src/TcpListener.cpp @@ -48,14 +48,15 @@ namespace fr { continue; } - //Set address re-use option + +#ifndef _WIN32 + //Set address re-use option if not on Windows (potentially sketchy) if(setsockopt(socket_descriptor, SOL_SOCKET, SO_REUSEADDR, (char*)&yes, sizeof(int)) == SOCKET_ERROR) { continue; } //Set port re-use option -#ifndef _WIN32 if(setsockopt(socket_descriptor, SOL_SOCKET, SO_REUSEPORT, (char*)&yes, sizeof(int)) == SOCKET_ERROR) { continue;