Skip to content

Commit

Permalink
refactor: move DEFAULT_SOCKETEVENTS to util/sock.h
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed May 9, 2024
1 parent 53b5981 commit ca1d635
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions src/util/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
#include <string>
#include <unordered_map>

#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.
Expand Down

0 comments on commit ca1d635

Please sign in to comment.