Code

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 b07b3bf21f371b15d71f9ae796f99076b60cb28b..77069c08a8d1f7532019d20de92fdedbac785e5e 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);