mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
Merge pull request #609 from MihailRis/add-network-tests
Add network tests
This commit is contained in:
commit
ee7ae3b9f6
7 changed files with 93 additions and 16 deletions
|
|
@ -96,7 +96,7 @@ public:
|
|||
onResponse,
|
||||
onReject,
|
||||
maxSize,
|
||||
false,
|
||||
true,
|
||||
"",
|
||||
std::move(headers)};
|
||||
processRequest(std::move(request));
|
||||
|
|
@ -590,10 +590,12 @@ public:
|
|||
}
|
||||
int opt = 1;
|
||||
int flags = SO_REUSEADDR;
|
||||
# ifndef _WIN32
|
||||
# if !defined(_WIN32) && !defined(__APPLE__)
|
||||
flags |= SO_REUSEPORT;
|
||||
# endif
|
||||
if (setsockopt(descriptor, SOL_SOCKET, flags, (const char*)&opt, sizeof(opt))) {
|
||||
logger.error() << "setsockopt(SO_REUSEADDR) failed with errno: "
|
||||
<< errno << "(" << std::strerror(errno) << ")";
|
||||
closesocket(descriptor);
|
||||
throw std::runtime_error("setsockopt");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue