[spice-server 3/3] Set TCP_KEEPINTVL when enabling TCP keepalive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Otherwise we are only changing the timeout before the first keepalive
probe is sent.
---
 server/reds.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/server/reds.c b/server/reds.c
index b1e1139..3cc6d48 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2309,6 +2309,14 @@ static bool reds_init_keepalive(int socket)
         }
     }
 
+    if (setsockopt(socket, SOL_TCP, TCP_KEEPINTVL,
+                   &keepalive_timeout, sizeof(keepalive_timeout)) == -1) {
+        if (errno != ENOTSUP) {
+            spice_printerr("setsockopt for keepalive interval failed, %s", strerror(errno));
+            return false;
+        }
+    }
+
     return true;
 }
 
-- 
2.5.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]