set SO_KEEPALIVE on client sockets
authorDaniel Albers <daniel@lbe.rs>
Mon, 6 Jan 2014 14:27:12 +0000 (15:27 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 13 Jan 2014 23:24:18 +0000 (00:24 +0100)
src/client/clientauthhandler.cpp
src/core/corenetwork.cpp

index b122e2f..8fc2a73 100644 (file)
@@ -144,6 +144,8 @@ void ClientAuthHandler::onSocketConnected()
         return;
     }
 
         return;
     }
 
+    socket()->setSocketOption(QAbstractSocket::KeepAliveOption, true);
+
     _peer = new LegacyPeer(this, socket(), this);
 
     connect(_peer, SIGNAL(transferProgress(int,int)), SIGNAL(transferProgress(int,int)));
     _peer = new LegacyPeer(this, socket(), this);
 
     connect(_peer, SIGNAL(transferProgress(int,int)), SIGNAL(transferProgress(int,int)));
index 87f1484..206b019 100644 (file)
@@ -439,6 +439,8 @@ void CoreNetwork::socketInitialized()
         return;
 #endif
 
         return;
 #endif
 
+    socket.setSocketOption(QAbstractSocket::KeepAliveOption, true);
+
     CoreIdentity *identity = identityPtr();
     if (!identity) {
         qCritical() << "Identity invalid!";
     CoreIdentity *identity = identityPtr();
     if (!identity) {
         qCritical() << "Identity invalid!";