| 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_UDP_SOCKET_WIN_H_ | 5 #ifndef NET_UDP_UDP_SOCKET_WIN_H_ |
| 6 #define NET_UDP_UDP_SOCKET_WIN_H_ | 6 #define NET_UDP_UDP_SOCKET_WIN_H_ |
| 7 | 7 |
| 8 #include <winsock2.h> | 8 #include <winsock2.h> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 // Leave the multicast group. | 124 // Leave the multicast group. |
| 125 // |group_address| is the group address to leave, could be either | 125 // |group_address| is the group address to leave, could be either |
| 126 // an IPv4 or IPv6 address. If the socket hasn't joined the group, | 126 // an IPv4 or IPv6 address. If the socket hasn't joined the group, |
| 127 // it will be ignored. | 127 // it will be ignored. |
| 128 // It's optional to leave the multicast group before destroying | 128 // It's optional to leave the multicast group before destroying |
| 129 // the socket. It will be done by the OS. | 129 // the socket. It will be done by the OS. |
| 130 // Return a network error code. | 130 // Return a network error code. |
| 131 int LeaveGroup(const IPAddressNumber& group_address) const; | 131 int LeaveGroup(const IPAddressNumber& group_address) const; |
| 132 | 132 |
| 133 // Set interface to use for multicast. If |interface_index| set to 0, default |
| 134 // interface is used. |
| 135 // Should be called before Bind(). |
| 136 // Returns a network error code. |
| 137 int SetMulticastInterface(uint32 interface_index); |
| 138 |
| 133 // Set the time-to-live option for UDP packets sent to the multicast | 139 // Set the time-to-live option for UDP packets sent to the multicast |
| 134 // group address. The default value of this option is 1. | 140 // group address. The default value of this option is 1. |
| 135 // Cannot be negative or more than 255. | 141 // Cannot be negative or more than 255. |
| 136 // Should be called before Bind(). | 142 // Should be called before Bind(). |
| 137 int SetMulticastTimeToLive(int time_to_live); | 143 int SetMulticastTimeToLive(int time_to_live); |
| 138 | 144 |
| 139 // Set the loopback flag for UDP socket. If this flag is true, the host | 145 // Set the loopback flag for UDP socket. If this flag is true, the host |
| 140 // will receive packets sent to the joined group from itself. | 146 // will receive packets sent to the joined group from itself. |
| 141 // The default value of this option is true. | 147 // The default value of this option is true. |
| 142 // Should be called before Bind(). | 148 // Should be called before Bind(). |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // to an IPEndPoint and writes it to |address|. Returns true on success. | 206 // to an IPEndPoint and writes it to |address|. Returns true on success. |
| 201 bool ReceiveAddressToIPEndpoint(IPEndPoint* address) const; | 207 bool ReceiveAddressToIPEndpoint(IPEndPoint* address) const; |
| 202 | 208 |
| 203 SOCKET socket_; | 209 SOCKET socket_; |
| 204 int addr_family_; | 210 int addr_family_; |
| 205 | 211 |
| 206 // Bitwise-or'd combination of SocketOptions. Specifies the set of | 212 // Bitwise-or'd combination of SocketOptions. Specifies the set of |
| 207 // options that should be applied to |socket_| before Bind(). | 213 // options that should be applied to |socket_| before Bind(). |
| 208 int socket_options_; | 214 int socket_options_; |
| 209 | 215 |
| 216 // Multicast interface. |
| 217 uint32 multicast_interface_; |
| 218 |
| 210 // Multicast socket options cached for SetSocketOption. | 219 // Multicast socket options cached for SetSocketOption. |
| 211 // Cannot be used after Bind(). | 220 // Cannot be used after Bind(). |
| 212 int multicast_time_to_live_; | 221 int multicast_time_to_live_; |
| 213 | 222 |
| 214 // How to do source port binding, used only when UDPSocket is part of | 223 // How to do source port binding, used only when UDPSocket is part of |
| 215 // UDPClientSocket, since UDPServerSocket provides Bind. | 224 // UDPClientSocket, since UDPServerSocket provides Bind. |
| 216 DatagramSocket::BindType bind_type_; | 225 DatagramSocket::BindType bind_type_; |
| 217 | 226 |
| 218 // PRNG function for generating port numbers. | 227 // PRNG function for generating port numbers. |
| 219 RandIntCallback rand_int_cb_; | 228 RandIntCallback rand_int_cb_; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 241 CompletionCallback write_callback_; | 250 CompletionCallback write_callback_; |
| 242 | 251 |
| 243 BoundNetLog net_log_; | 252 BoundNetLog net_log_; |
| 244 | 253 |
| 245 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); | 254 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); |
| 246 }; | 255 }; |
| 247 | 256 |
| 248 } // namespace net | 257 } // namespace net |
| 249 | 258 |
| 250 #endif // NET_UDP_UDP_SOCKET_WIN_H_ | 259 #endif // NET_UDP_UDP_SOCKET_WIN_H_ |
| OLD | NEW |