summaryrefslogtreecommitdiff
path: root/include/net/server.hpp
diff options
context:
space:
mode:
authorhovertank3d <[email protected]>2026-02-23 03:05:12 +0100
committerhovertank3d <[email protected]>2026-02-23 03:05:12 +0100
commit6c79fe43fe2d6bbbb2808777e5553a7360b37d22 (patch)
tree2424694c6da8807a3447d05e9f4c8057042d14a2 /include/net/server.hpp
parentbf1a13611b05350a71807be9a7cc384f11737b2b (diff)
downloadogurec-6c79fe43fe2d6bbbb2808777e5553a7360b37d22.tar.gz
ogurec-6c79fe43fe2d6bbbb2808777e5553a7360b37d22.zip
revert to being a raw proxy
Diffstat (limited to 'include/net/server.hpp')
-rw-r--r--include/net/server.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/server.hpp b/include/net/server.hpp
index 9b5e7c5..f2b5240 100644
--- a/include/net/server.hpp
+++ b/include/net/server.hpp
@@ -1,8 +1,6 @@
#pragma once
#include <cerrno>
-#include <cstdio>
-#include <cstdlib>
#include <cstring>
#include <stdexcept>
#include <string>
@@ -45,6 +43,9 @@ public:
if (sock_fd < 0)
throw std::runtime_error(strerror(errno));
+ int yes=1;
+ setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes);
+
int bindStatus = ::bind(sock_fd, (struct sockaddr*)&server_address, sizeof(server_address));
if (bindStatus < 0)
throw std::runtime_error(strerror(errno));