From c3cd71b6b7dd956fa3c05f588b61e3c5b93d1366 Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Sun, 18 Jan 2015 10:40:29 +0100 Subject: [PATCH] devicechannel: enable TCP socket keepalive --- src/devicechannel.vala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/devicechannel.vala b/src/devicechannel.vala index 634de34..23f9a2c 100644 --- a/src/devicechannel.vala +++ b/src/devicechannel.vala @@ -70,6 +70,9 @@ class DeviceChannel : Object { // setup socket monitoring Socket sock = _conn.get_socket(); + // enable keepalive + sock.set_keepalive(true); + // prep source for monitoring events SocketSource source = sock.create_source(IOCondition.IN | IOCondition.ERR | IOCondition.HUP); source.set_callback((src, cond) => {