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

Unified Diff: net/udp/datagram_server_socket.h

Issue 15995023: Add multicast support to DatagramServerSocket (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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 | « content/browser/renderer_host/p2p/socket_host_udp_unittest.cc ('k') | net/udp/udp_server_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/datagram_server_socket.h
diff --git a/net/udp/datagram_server_socket.h b/net/udp/datagram_server_socket.h
index a1aa38bdefff72a8a24f7c2e263ade0b3b55af73..67120fee8806cada8336f1fe054ef080e81c7418 100644
--- a/net/udp/datagram_server_socket.h
+++ b/net/udp/datagram_server_socket.h
@@ -6,6 +6,7 @@
#define NET_UDP_DATAGRAM_SERVER_SOCKET_H_
#include "net/base/completion_callback.h"
+#include "net/base/net_util.h"
#include "net/udp/datagram_socket.h"
namespace net {
@@ -67,6 +68,35 @@ class NET_EXPORT DatagramServerSocket : public DatagramSocket {
// Allow sending and receiving packets to and from broadcast addresses.
// Should be called before Listen().
virtual void AllowBroadcast() = 0;
+
+ // Join the multicast group.
+ // |group_address| is the group address to join, could be either
Sergey Ulanov 2013/06/07 19:59:38 nit: Suggest rephrasing: "Join multicast group wit
+ // an IPv4 or IPv6 address.
+ // Return a network error code.
Sergey Ulanov 2013/06/07 19:59:38 nit: s/Return/Returns/, here and below.
+ virtual int JoinGroup(const IPAddressNumber& group_address) const = 0;
+
+ // Leave the multicast group.
+ // |group_address| is the group address to leave, could be either
Sergey Ulanov 2013/06/07 19:59:38 Repharase similar to JoinGroup() please.
+ // an IPv4 or IPv6 address. If the socket hasn't joined the group,
+ // it will be ignored.
+ // It's optional to leave the multicast group before destroying
+ // the socket. It will be done by the OS.
+ // Return a network error code.
+ virtual int LeaveGroup(const IPAddressNumber& group_address) const = 0;
+
+ // Set the time-to-live option for UDP packets sent to the multicast
+ // group address. The default value of this option is 1.
+ // Cannot be negative or more than 255.
+ // Should be called before Bind().
+ // Return a network error code.
+ virtual int SetMulticastTimeToLive(int time_to_live) = 0;
+
+ // Set the loopback flag for UDP socket. If this flag is true, the host
+ // will receive packets sent to the joined group from itself.
+ // The default value of this option is true.
+ // Should be called before Bind().
+ // Return a network error code.
+ virtual int SetMulticastLoopbackMode(bool loopback) = 0;
};
} // namespace net
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_udp_unittest.cc ('k') | net/udp/udp_server_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698