Don't set SO_REUSEADDR on Windows

This commit is contained in:
Fred Nicolson 2019-04-26 09:59:57 +01:00
parent 00f13e41e7
commit 7f1c25a73b
No known key found for this signature in database
GPG Key ID: 78C1DD87B47797D2

View File

@ -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;