Index: net/udp/udp_socket_libevent.h |
diff --git a/net/udp/udp_socket_libevent.h b/net/udp/udp_socket_libevent.h |
index ce8a0f2269ad4c39dbe6f8b7e997216ecebde42a..83f78cb461858dc94ba8c4a7b4c582237b37182f 100644 |
--- a/net/udp/udp_socket_libevent.h |
+++ b/net/udp/udp_socket_libevent.h |
@@ -5,6 +5,7 @@ |
#ifndef NET_UDP_UDP_SOCKET_LIBEVENT_H_ |
#define NET_UDP_UDP_SOCKET_LIBEVENT_H_ |
+#include "base/hash_tables.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop.h" |
@@ -113,6 +114,29 @@ class NET_EXPORT UDPSocketLibevent : public base::NonThreadSafe { |
// called before Bind(). |
void AllowBroadcast(); |
scheib
2013/04/02 18:25:17
We should have tests in the /net/ directory. Proba
|
+ // Join the multicast group. |
+ // |group_address| is the group address to join, could be either |
+ // IPv4 or IPv6 address. |
+ int JoinGroup(const net::IPAddressNumber& group_address) const; |
+ |
+ // Join the multicast group. |
scheib
2013/04/02 18:25:17
Leave ...
Bei Zhang
2013/04/05 00:38:59
Done.
|
+ // |group_address| is the group address to join, could be either |
+ // 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. |
+ int LeaveGroup(const net::IPAddressNumber& group_address) const; |
+ |
+ // Set the time-to-live option for udp packets sent to the multicast |
scheib
2013/04/02 18:25:17
What unit is this int? seconds? ms?
Bei Zhang
2013/04/05 00:38:59
This is measured by hops. So it's a unitless.
On
|
+ // group address. Initially this value is 1. Cannot be negative or |
+ // more than 255. |
+ int SetMulticastTimeToLive(int timeToLive); |
+ |
+ // Set the loopback flag for udp socket. If this flag is true, the host |
+ // will receive package sent to the joined group from itself. |
+ // Initially this value is true. |
+ int SetMulticastLoopbackMode(bool loopback); |
+ |
private: |
static const int kInvalidSocket = -1; |
@@ -188,6 +212,7 @@ class NET_EXPORT UDPSocketLibevent : public base::NonThreadSafe { |
int RandomBind(const IPEndPoint& address); |
int socket_; |
+ int sock_addr_family_; |
// Bitwise-or'd combination of SocketOptions. Specifies the set of |
// options that should be applied to |socket_| before Bind(). |