relay.enableTcpKeepalive config option. default = false

This commit is contained in:
Doug Hoyte
2023-01-13 14:34:54 -05:00
parent efd40be1aa
commit a5c4df16f3
3 changed files with 4 additions and 2 deletions

2
golpe

Submodule golpe updated: f76f58fbbb...72a016041f

View File

@ -92,6 +92,8 @@ config:
- name: relay__autoPingSeconds - name: relay__autoPingSeconds
default: 55 default: 55
noReload: true noReload: true
- name: relay__enableTcpKeepalive
default: false
- name: relay__queryTimesliceBudgetMicroseconds - name: relay__queryTimesliceBudgetMicroseconds
default: 10000 default: 10000
- name: relay__maxFilterLimit - name: relay__maxFilterLimit

View File

@ -82,7 +82,7 @@ void RelayServer::runWebsocket(ThreadPool<MsgWebsocket>::Thread &thr) {
ws->setUserData((void*)c); ws->setUserData((void*)c);
connIdToConnection.emplace(connId, c); connIdToConnection.emplace(connId, c);
{ if (cfg().relay__enableTcpKeepalive) {
int optval = 1; int optval = 1;
if (setsockopt(ws->getFd(), SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval))) { if (setsockopt(ws->getFd(), SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval))) {
LW << "Failed to enable TCP keepalive: " << strerror(errno); LW << "Failed to enable TCP keepalive: " << strerror(errno);