aboutsummaryrefslogtreecommitdiffstats
path: root/util/network
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-01-11 14:49:03 +0100
committerGitHub <noreply@github.com>2024-01-11 14:49:03 +0100
commit2e180154bd6a38b90a128ba0463d0dd2706a5ccf (patch)
tree0e0890fa08e63af33c52c9b6eacee56d037a740b /util/network
parent4366d88bef9360d9754e77eaa1f4a25d046a9cbd (diff)
downloadydb-2e180154bd6a38b90a128ba0463d0dd2706a5ccf.tar.gz
Library import 7 (#937)
Diffstat (limited to 'util/network')
-rw-r--r--util/network/socket.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/util/network/socket.cpp b/util/network/socket.cpp
index f6b1132222..eaaf0c9cb6 100644
--- a/util/network/socket.cpp
+++ b/util/network/socket.cpp
@@ -307,17 +307,13 @@ void SetInputBuffer(SOCKET s, unsigned value) {
CheckedSetSockOpt(s, SOL_SOCKET, SO_RCVBUF, value, "input buffer");
}
-#if defined(_linux_) && !defined(SO_REUSEPORT)
- #define SO_REUSEPORT 15
-#endif
-
void SetReusePort(SOCKET s, bool value) {
-#if defined(SO_REUSEPORT)
+#if defined(_unix_)
CheckedSetSockOpt(s, SOL_SOCKET, SO_REUSEPORT, (int)value, "reuse port");
#else
Y_UNUSED(s);
Y_UNUSED(value);
- ythrow TSystemError(ENOSYS) << "SO_REUSEPORT is not defined";
+ ythrow TSystemError(ENOSYS) << "SO_REUSEPORT is not available on Windows";
#endif
}