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

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: Added comment for SO_REUSEPORT socket option and deleted redundant check for existence of SO_REUSEP… 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..9a44945622975cd0925c19b4bc5c8fe2547cf72e 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 instances of a program to
wtc 2012/09/18 14:40:32 Did you mean "multiple instances of the same progr
ygorshenin1 2012/09/18 14:54:22 I thought "multiple processes" will be better. Tha
+ // 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