From b777d31a98dfb55e2d81712d51de5dc1383be2e5 Mon Sep 17 00:00:00 2001 From: Shahar Mike Date: Tue, 23 Jan 2024 10:19:53 +0200 Subject: [PATCH] feat(server): Add `backlog` flag for `listen()` (#2456) * feat(server): Add `backlog` flag for `listen()` --- src/server/dfly_main.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/dfly_main.cc b/src/server/dfly_main.cc index 734ec1569685..9ff31e9e2b2f 100644 --- a/src/server/dfly_main.cc +++ b/src/server/dfly_main.cc @@ -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; @@ -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;