Created
November 10, 2015 02:45
-
-
Save jolexa/ee9e152aa7045c558e02 to your computer and use it in GitHub Desktop.
mesos socket keepalive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git diff | |
diff --git a/3rdparty/libprocess/include/process/network.hpp b/3rdparty/libprocess/include/process/network.hpp | |
index 61bfa82..32c14e3 100644 | |
--- a/3rdparty/libprocess/include/process/network.hpp | |
+++ b/3rdparty/libprocess/include/process/network.hpp | |
@@ -44,6 +44,10 @@ inline Try<int> socket(int family, int type, int protocol) | |
return ErrnoError(); | |
} | |
#endif // __APPLE__ | |
+ const int enable = 1; | |
+ if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(int)) == -1) { | |
+ return ErrnoError(); | |
+ } | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment