From 63c093db824a7e0aa8d5283515ef39909d7661c5 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 9 May 2024 16:18:39 +0000 Subject: [PATCH] refactor: move `DEFAULT_SOCKETEVENTS` to `util/sock.h` --- src/net.h | 10 ---------- src/util/sock.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/net.h b/src/net.h index bd9cfdab64df55..753e701b1e09ab 100644 --- a/src/net.h +++ b/src/net.h @@ -109,16 +109,6 @@ static const bool DEFAULT_FIXEDSEEDS = true; static const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000; static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000; -#if defined USE_KQUEUE -#define DEFAULT_SOCKETEVENTS "kqueue" -#elif defined USE_EPOLL -#define DEFAULT_SOCKETEVENTS "epoll" -#elif defined USE_POLL -#define DEFAULT_SOCKETEVENTS "poll" -#else -#define DEFAULT_SOCKETEVENTS "select" -#endif - typedef int64_t NodeId; struct AddedNodeInfo diff --git a/src/util/sock.h b/src/util/sock.h index ab7c26e4ac1770..4b789d2782321e 100644 --- a/src/util/sock.h +++ b/src/util/sock.h @@ -16,6 +16,16 @@ #include #include +#if defined(USE_EPOLL) +#define DEFAULT_SOCKETEVENTS "epoll" +#elif defined(USE_KQUEUE) +#define DEFAULT_SOCKETEVENTS "kqueue" +#elif defined(USE_POLL) +#define DEFAULT_SOCKETEVENTS "poll" +#else +#define DEFAULT_SOCKETEVENTS "select" +#endif + /** * Maximum time to wait for I/O readiness. * It will take up until this time to break off in case of an interruption.