Skip to content

Commit

Permalink
1.fix compile error in MAC OS X for TCP_KEEPIDLE
Browse files Browse the repository at this point in the history
2.change the version to 1.0.5-pre
  • Loading branch information
fortrue committed Apr 23, 2018
1 parent a856f26 commit 28edb79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 4 additions & 0 deletions src/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}

Expand Down

0 comments on commit 28edb79

Please sign in to comment.