mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
improve setsockopt error message
This commit is contained in:
parent
51859c1501
commit
ee663fa322
1 changed files with 2 additions and 0 deletions
|
|
@ -594,6 +594,8 @@ public:
|
||||||
flags |= SO_REUSEPORT;
|
flags |= SO_REUSEPORT;
|
||||||
# endif
|
# endif
|
||||||
if (setsockopt(descriptor, SOL_SOCKET, flags, (const char*)&opt, sizeof(opt))) {
|
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);
|
closesocket(descriptor);
|
||||||
throw std::runtime_error("setsockopt");
|
throw std::runtime_error("setsockopt");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue