mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +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");
|
||||
}
|
||||
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);
|
||||
throw std::runtime_error("setsockopt");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue