From 18d238d38c23291f332fbfb96dd8756965a6e4bd Mon Sep 17 00:00:00 2001 From: Dave Behnke <916775+dbehnke@users.noreply.github.com> Date: Sat, 27 Dec 2025 17:49:18 -0500 Subject: [PATCH] fix(nng): increase send/recv buffers to 4096 to prevent blocking/drops --- reflector/TCSocket.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reflector/TCSocket.cpp b/reflector/TCSocket.cpp index 485369b..5291e22 100644 --- a/reflector/TCSocket.cpp +++ b/reflector/TCSocket.cpp @@ -152,6 +152,11 @@ bool CTCServer::Open(const std::string &address, const std::string &modules, uin // Set receive timeout to 100ms for dispatcher loop nng_duration timeout = 100; nng_socket_set_ms(m_Sock, NNG_OPT_RECVTIMEO, timeout); + + // Increase buffers to prevent blocking/drops during high load/jitter + int bufSize = 4096; + nng_socket_set_int(m_Sock, NNG_OPT_RECVBUF, bufSize); + nng_socket_set_int(m_Sock, NNG_OPT_SENDBUF, bufSize); std::stringstream url; if (address.find("ipc://") == 0) {