mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 22:41:49 +00:00
fix msvc build
This commit is contained in:
parent
a72d36f53c
commit
9e8addbd7d
1 changed files with 5 additions and 1 deletions
|
|
@ -502,7 +502,11 @@ public:
|
||||||
throw std::runtime_error("Could not create server socket");
|
throw std::runtime_error("Could not create server socket");
|
||||||
}
|
}
|
||||||
int opt = 1;
|
int opt = 1;
|
||||||
if (setsockopt(descriptor, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT, &opt, sizeof(opt))) {
|
int flags = SO_REUSEADDR;
|
||||||
|
# ifndef _WIN32
|
||||||
|
flags |= SO_REUSEPORT;
|
||||||
|
# endif
|
||||||
|
if (setsockopt(descriptor, SOL_SOCKET, flags, &opt, sizeof(opt))) {
|
||||||
closesocket(descriptor);
|
closesocket(descriptor);
|
||||||
throw std::runtime_error("setsockopt");
|
throw std::runtime_error("setsockopt");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue