From ac6b164b8b758deff3ebc3946177988e6d72ca9a Mon Sep 17 00:00:00 2001 From: Daniel Albers Date: Mon, 6 Jan 2014 15:27:12 +0100 Subject: [PATCH] set SO_KEEPALIVE on client sockets --- src/client/clientauthhandler.cpp | 2 ++ src/core/corenetwork.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/client/clientauthhandler.cpp b/src/client/clientauthhandler.cpp index b122e2f4..8fc2a731 100644 --- a/src/client/clientauthhandler.cpp +++ b/src/client/clientauthhandler.cpp @@ -144,6 +144,8 @@ void ClientAuthHandler::onSocketConnected() return; } + socket()->setSocketOption(QAbstractSocket::KeepAliveOption, true); + _peer = new LegacyPeer(this, socket(), this); connect(_peer, SIGNAL(transferProgress(int,int)), SIGNAL(transferProgress(int,int))); diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 87f1484a..206b0194 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -439,6 +439,8 @@ void CoreNetwork::socketInitialized() return; #endif + socket.setSocketOption(QAbstractSocket::KeepAliveOption, true); + CoreIdentity *identity = identityPtr(); if (!identity) { qCritical() << "Identity invalid!"; -- 2.20.1