write_sensu: enable TCP keepalive on network socket
authorMarc Fournier <marc.fournier@camptocamp.com>
Sat, 13 Feb 2016 11:29:30 +0000 (12:29 +0100)
committerMarc Fournier <marc.fournier@camptocamp.com>
Tue, 9 Aug 2016 09:07:01 +0000 (11:07 +0200)
src/write_sensu.c

index b07b3bf..77069c0 100644 (file)
@@ -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);