dont try set per socket keepalive timing on bsds
As per http://libwebsockets.org/trac/ticket/10
BSD doesn't support setting keepalive info per-socket
Signed-off-by: Andy Green <andy.green@linaro.org>
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index dd58ff1..f5dfceb 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -537,6 +537,14 @@
(const void *)&optval, optlen) < 0)
return 1;
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+
+ /*
+ * didn't find a way to set these per-socket, need to
+ * tune kernel systemwide values
+ */
+
+#else
/* set the keepalive conditions we want on it too */
optval = context->ka_time;
if (setsockopt(fd, IPPROTO_IP, TCP_KEEPIDLE,
@@ -552,6 +560,7 @@
if (setsockopt(fd, IPPROTO_IP, TCP_KEEPCNT,
(const void *)&optval, optlen) < 0)
return 1;
+#endif
}
/* Disable Nagle */