mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 14:36:42 +08:00
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:
parent
a856f2607f
commit
28edb79c61
@ -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
|
||||
{
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user