1.fix compile error in MAC OS X for TCP_KEEPIDLE

2.change the version to 1.0.5-pre
This commit is contained in:
fortrue 2018-04-23 14:00:27 +08:00
parent a856f2607f
commit 28edb79c61
2 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,7 @@
#include <limits.h>
#define _PREDIXY_NAME_ "predixy"
#define _PREDIXY_VERSION_ "1.0.4"
#define _PREDIXY_VERSION_ "1.0.5-pre"
namespace Const
{

View File

@ -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;
}