Skip to content

Commit

Permalink
feat(server): Add backlog flag for listen() (#2456)
Browse files Browse the repository at this point in the history
* feat(server): Add `backlog` flag for `listen()`
  • Loading branch information
chakaz authored Jan 23, 2024
1 parent a16b940 commit b777d31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server/dfly_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ ABSL_FLAG(bool, force_epoll, false,
ABSL_FLAG(bool, version_check, true,
"If true, Will monitor for new releases on Dragonfly servers once a day.");

ABSL_FLAG(uint16_t, tcp_backlog, 128, "TCP listen(2) backlog parameter.");

using namespace util;
using namespace facade;
using namespace io;
Expand Down Expand Up @@ -711,6 +713,7 @@ Usage: dragonfly [FLAGS]
pool->Run();

AcceptServer acceptor(pool.get());
acceptor.set_back_log(absl::GetFlag(FLAGS_tcp_backlog));

int res = dfly::RunEngine(pool.get(), &acceptor) ? 0 : -1;

Expand Down

0 comments on commit b777d31

Please sign in to comment.