Skip to content

Commit bf00f4c

Browse files
committed
Fix[bmqio]: Use largest connection backlog allowed by OS
When listening on a new socket, `bmqio_ntcchannel` sets the connection backlog size to be ten connections. This allows at most ten connections to the socket to be waiting to be accepted before they are rejected by the OS for us. Ten is quite a low number, and seems like a mistake. This patch changes the backlog to be determined by NTF, which makes it as large as the OS allows. Signed-off-by: Patrick M. Niedzielski <[email protected]>
1 parent 4e73b8b commit bf00f4c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/groups/bmq/bmqio/bmqio_ntcchannel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,9 @@ int NtcListener::listen(bmqio::Status* status,
15791579
int backlog;
15801580
if (!options.properties().load(&backlog,
15811581
NtcListenerUtil::listenBacklogProperty())) {
1582-
backlog = 10;
1582+
// The magic number 0 means the backlog will be the maximum allowed by
1583+
// the OS.
1584+
backlog = 0;
15831585
}
15841586

15851587
ntsa::Endpoint endpoint;

0 commit comments

Comments
 (0)