From 28edb79c617d5ef068024447b650a42643fe965a Mon Sep 17 00:00:00 2001 From: fortrue Date: Mon, 23 Apr 2018 14:00:27 +0800 Subject: [PATCH] 1.fix compile error in MAC OS X for TCP_KEEPIDLE 2.change the version to 1.0.5-pre --- src/Common.h | 2 +- src/Socket.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Common.h b/src/Common.h index 4be70f9..07e3e52 100644 --- a/src/Common.h +++ b/src/Common.h @@ -10,7 +10,7 @@ #include #define _PREDIXY_NAME_ "predixy" -#define _PREDIXY_VERSION_ "1.0.4" +#define _PREDIXY_VERSION_ "1.0.5-pre" namespace Const { diff --git a/src/Socket.cpp b/src/Socket.cpp index 2d13038..61e3131 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -162,6 +162,7 @@ bool Socket::setTcpKeepAlive(int interval) if (ret != 0) { return false; } +#ifdef __linux__ val = interval; ret = setsockopt(mFd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)); if (ret != 0) { @@ -177,6 +178,9 @@ bool Socket::setTcpKeepAlive(int interval) if (ret != 0) { return false; } +#else + ((void)interval); //Avoid unused var warning for non Linux systems +#endif return true; }