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

Unified Diff: net/udp/udp_socket_libevent.cc

Issue 10917235: SO_REUSEPORT is moved from AddressReuse feature to Broadcast feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comment. Created 8 years, 3 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/udp/udp_socket_libevent.cc
diff --git a/net/udp/udp_socket_libevent.cc b/net/udp/udp_socket_libevent.cc
index beb1dcaf87d896064cf6f4ce8220442b94f31a18..a879ecb54da1c7719e8aad8bcb893f8e4f2cd014 100644
--- a/net/udp/udp_socket_libevent.cc
+++ b/net/udp/udp_socket_libevent.cc
@@ -465,16 +465,20 @@ int UDPSocketLibevent::SetSocketOptions() {
sizeof(true_value));
if (rv < 0)
return MapSystemError(errno);
-#if defined(SO_REUSEPORT)
+ }
+ if (socket_options_ & SOCKET_OPTION_BROADCAST) {
+ int rv;
+#if defined(OS_MACOSX)
+ // SO_REUSEPORT on OSX permits multiple processes to each receive
+ // UDP multicast or broadcast datagrams destined for the bound
+ // port.
rv = setsockopt(socket_, SOL_SOCKET, SO_REUSEPORT, &true_value,
sizeof(true_value));
if (rv < 0)
return MapSystemError(errno);
-#endif
- }
- if (socket_options_ & SOCKET_OPTION_BROADCAST) {
- int rv = setsockopt(socket_, SOL_SOCKET, SO_BROADCAST, &true_value,
- sizeof(true_value));
+#endif // defined(OS_MACOSX)
+ rv = setsockopt(socket_, SOL_SOCKET, SO_BROADCAST, &true_value,
+ sizeof(true_value));
if (rv < 0)
return MapSystemError(errno);
}
« 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