fix(nng): increase send/recv buffers to 4096 to prevent blocking/drops

pull/23/head
Dave Behnke 1 month ago
parent 3b3f65b20e
commit 18d238d38c

@ -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) {

Loading…
Cancel
Save

Powered by TurnKey Linux.