From f086e793482c4dd76786aff15a20a68973114467 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Sat, 13 Feb 2016 12:29:30 +0100 Subject: [PATCH] write_sensu: enable TCP keepalive on network socket --- src/write_sensu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/write_sensu.c b/src/write_sensu.c index b07b3bf2..77069c08 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -196,6 +196,8 @@ static int sensu_connect(struct sensu_host *host) /* {{{ */ if (setsockopt(host->s, SOL_SOCKET, SO_LINGER, &so_linger, sizeof so_linger) != 0) WARNING("write_sensu plugin: failed to set socket close() lingering"); + set_sock_opts(host->s); + // connect the socket if (connect(host->s, ai->ai_addr, ai->ai_addrlen) != 0) { close(host->s); -- 2.30.2