mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-18 17:27:11 +00:00
relay.enableTcpKeepalive config option. default = false
This commit is contained in:
2
golpe
2
golpe
Submodule golpe updated: f76f58fbbb...72a016041f
@ -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
|
||||||
|
@ -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);
|
||||||
|
Reference in New Issue
Block a user