1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00

feat(server): Add backlog flag for listen() (#2456)

* feat(server): Add `backlog` flag for `listen()`
This commit is contained in:
Shahar Mike 2024-01-23 10:19:53 +02:00 committed by GitHub
parent a16b940a65
commit b777d31a98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;