Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1261)

Unified Diff: net/socket/tcp_socket_libevent.cc

Issue 1065563006: Add code to set TCP keep alive delay on OSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Oops Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_socket_libevent.cc
diff --git a/net/socket/tcp_socket_libevent.cc b/net/socket/tcp_socket_libevent.cc
index c5d30e1d5b085ec3781c3ca74044f7402fbd5283..187f5d34ae725010743fdb47eb14ef7ece4177d6 100644
--- a/net/socket/tcp_socket_libevent.cc
+++ b/net/socket/tcp_socket_libevent.cc
@@ -77,6 +77,11 @@ bool SetTCPKeepAlive(int fd, bool enable, int delay) {
PLOG(ERROR) << "Failed to set TCP_KEEPINTVL on fd: " << fd;
return false;
}
+#elif defined(OS_MACOSX) || defined(OS_IOS)
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &delay, sizeof(delay))) {
+ PLOG(ERROR) << "Failed to set TCP_KEEPALIVE on fd: " << fd;
+ return false;
+ }
#endif
Jana 2015/04/06 23:20:00 Should there be a #else? What are the platforms th
mmenke 2015/04/07 15:28:06 There's also ChromeOS, but I believe that has OS_L
Jana 2015/04/07 19:47:19 I think that the FBSD code is close to the MacOS c
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698