Socket options require Qt 4.6+
[quassel.git] / src / core / corenetwork.cpp
index 87f1484..3fd0a1a 100644 (file)
@@ -438,7 +438,9 @@ void CoreNetwork::socketInitialized()
     if (server.useSsl && !socket.isEncrypted())
         return;
 #endif
-
+#if QT_VERSION >= 0x040600
+    socket.setSocketOption(QAbstractSocket::KeepAliveOption, true);
+#endif
     CoreIdentity *identity = identityPtr();
     if (!identity) {
         qCritical() << "Identity invalid!";