OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_UDP_DATAGRAM_SERVER_SOCKET_H_ | 5 #ifndef NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
6 #define NET_UDP_DATAGRAM_SERVER_SOCKET_H_ | 6 #define NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
7 | 7 |
8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
9 #include "net/base/net_util.h" | 9 #include "net/base/net_util.h" |
10 #include "net/udp/datagram_socket.h" | 10 #include "net/udp/datagram_socket.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // Returns a network error code. | 73 // Returns a network error code. |
74 virtual int JoinGroup(const IPAddressNumber& group_address) const = 0; | 74 virtual int JoinGroup(const IPAddressNumber& group_address) const = 0; |
75 | 75 |
76 // Leave the multicast group with address |group_address|. | 76 // Leave the multicast group with address |group_address|. |
77 // If the socket hasn't joined the group, it will be ignored. | 77 // If the socket hasn't joined the group, it will be ignored. |
78 // It's optional to leave the multicast group before destroying | 78 // It's optional to leave the multicast group before destroying |
79 // the socket. It will be done by the OS. | 79 // the socket. It will be done by the OS. |
80 // Returns a network error code. | 80 // Returns a network error code. |
81 virtual int LeaveGroup(const IPAddressNumber& group_address) const = 0; | 81 virtual int LeaveGroup(const IPAddressNumber& group_address) const = 0; |
82 | 82 |
| 83 // Set interface to use for multicast. If |interface_index| set to 0, default |
| 84 // interface is used. |
| 85 // Should be called before Bind(). |
| 86 // Returns a network error code. |
| 87 virtual int SetMulticastInterface(uint32 interface_index) = 0; |
| 88 |
83 // Set the time-to-live option for UDP packets sent to the multicast | 89 // Set the time-to-live option for UDP packets sent to the multicast |
84 // group address. The default value of this option is 1. | 90 // group address. The default value of this option is 1. |
85 // Cannot be negative or more than 255. | 91 // Cannot be negative or more than 255. |
86 // Should be called before Bind(). | 92 // Should be called before Bind(). |
87 // Returns a network error code. | 93 // Returns a network error code. |
88 virtual int SetMulticastTimeToLive(int time_to_live) = 0; | 94 virtual int SetMulticastTimeToLive(int time_to_live) = 0; |
89 | 95 |
90 // Set the loopback flag for UDP socket. If this flag is true, the host | 96 // Set the loopback flag for UDP socket. If this flag is true, the host |
91 // will receive packets sent to the joined group from itself. | 97 // will receive packets sent to the joined group from itself. |
92 // The default value of this option is true. | 98 // The default value of this option is true. |
93 // Should be called before Bind(). | 99 // Should be called before Bind(). |
94 // Returns a network error code. | 100 // Returns a network error code. |
95 virtual int SetMulticastLoopbackMode(bool loopback) = 0; | 101 virtual int SetMulticastLoopbackMode(bool loopback) = 0; |
96 | 102 |
97 // Set the Differentiated Services Code Point. May do nothing on | 103 // Set the Differentiated Services Code Point. May do nothing on |
98 // some platforms. Returns a network error code. | 104 // some platforms. Returns a network error code. |
99 virtual int SetDiffServCodePoint(DiffServCodePoint dscp) = 0; | 105 virtual int SetDiffServCodePoint(DiffServCodePoint dscp) = 0; |
100 }; | 106 }; |
101 | 107 |
102 } // namespace net | 108 } // namespace net |
103 | 109 |
104 #endif // NET_UDP_DATAGRAM_SERVER_SOCKET_H_ | 110 #endif // NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
OLD | NEW |