Skip to content

Commit 6384f42

Browse files
committed
refactor: move DEFAULT_SOCKETEVENTS to util/sock.h
1 parent e6578c9 commit 6384f42

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/net.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,6 @@ static const bool DEFAULT_FIXEDSEEDS = true;
109109
static const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000;
110110
static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000;
111111

112-
#if defined USE_KQUEUE
113-
#define DEFAULT_SOCKETEVENTS "kqueue"
114-
#elif defined USE_EPOLL
115-
#define DEFAULT_SOCKETEVENTS "epoll"
116-
#elif defined USE_POLL
117-
#define DEFAULT_SOCKETEVENTS "poll"
118-
#else
119-
#define DEFAULT_SOCKETEVENTS "select"
120-
#endif
121-
122112
typedef int64_t NodeId;
123113

124114
struct AddedNodeInfo

src/util/sock.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616
#include <string>
1717
#include <unordered_map>
1818

19+
#if defined(USE_EPOLL)
20+
#define DEFAULT_SOCKETEVENTS "epoll"
21+
#elif defined(USE_KQUEUE)
22+
#define DEFAULT_SOCKETEVENTS "kqueue"
23+
#elif defined(USE_POLL)
24+
#define DEFAULT_SOCKETEVENTS "poll"
25+
#else
26+
#define DEFAULT_SOCKETEVENTS "select"
27+
#endif
28+
1929
/**
2030
* Maximum time to wait for I/O readiness.
2131
* It will take up until this time to break off in case of an interruption.

0 commit comments

Comments
 (0)