Chromium Code Reviews| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 // Note: the behavior of |SetMulticastLoopbackMode| is slightly | 144 // Note: the behavior of |SetMulticastLoopbackMode| is slightly |
| 145 // different between Windows and Unix-like systems. The inconsistency only | 145 // different between Windows and Unix-like systems. The inconsistency only |
| 146 // happens when there are more than one applications on the same host | 146 // happens when there are more than one applications on the same host |
| 147 // joined to the same multicast group while having different settings on | 147 // joined to the same multicast group while having different settings on |
| 148 // multicast loopback mode. On Windows, the applications with loopback off | 148 // multicast loopback mode. On Windows, the applications with loopback off |
| 149 // will not RECEIVE the loopback packets; while on Unix-like systems, the | 149 // will not RECEIVE the loopback packets; while on Unix-like systems, the |
| 150 // applications with loopback off will not SEND the loopback packets to | 150 // applications with loopback off will not SEND the loopback packets to |
| 151 // other applications on the same host. See MSDN: http://goo.gl/6vqbj | 151 // other applications on the same host. See MSDN: http://goo.gl/6vqbj |
| 152 int SetMulticastLoopbackMode(bool loopback); | 152 int SetMulticastLoopbackMode(bool loopback); |
| 153 | 153 |
| 154 // Set the differentiated services flags on outgoing packets. May not | |
| 155 // do anything on some platforms. | |
| 156 int SetTos(DiffServCodePoint dscp); | |
| 157 | |
| 154 private: | 158 private: |
| 155 enum SocketOptions { | 159 enum SocketOptions { |
| 156 SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, | 160 SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, |
| 157 SOCKET_OPTION_BROADCAST = 1 << 1, | 161 SOCKET_OPTION_BROADCAST = 1 << 1, |
| 158 SOCKET_OPTION_MULTICAST_LOOP = 1 << 2 | 162 SOCKET_OPTION_MULTICAST_LOOP = 1 << 2 |
| 159 }; | 163 }; |
| 160 | 164 |
| 161 class Core; | 165 class Core; |
| 162 | 166 |
| 163 void DoReadCallback(int rv); | 167 void DoReadCallback(int rv); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 int addr_family_; | 204 int addr_family_; |
| 201 | 205 |
| 202 // Bitwise-or'd combination of SocketOptions. Specifies the set of | 206 // Bitwise-or'd combination of SocketOptions. Specifies the set of |
| 203 // options that should be applied to |socket_| before Bind(). | 207 // options that should be applied to |socket_| before Bind(). |
| 204 int socket_options_; | 208 int socket_options_; |
| 205 | 209 |
| 206 // Multicast socket options cached for SetSocketOption. | 210 // Multicast socket options cached for SetSocketOption. |
| 207 // Cannot be used after Bind(). | 211 // Cannot be used after Bind(). |
| 208 int multicast_time_to_live_; | 212 int multicast_time_to_live_; |
| 209 | 213 |
| 214 // Differentiated Services Code Point. | |
|
cbentzel
2013/08/21 22:00:20
Not being used.
hubbe
2013/08/22 23:41:02
Done.
| |
| 215 DiffServCodePoint dscp_; | |
| 216 | |
| 210 // How to do source port binding, used only when UDPSocket is part of | 217 // How to do source port binding, used only when UDPSocket is part of |
| 211 // UDPClientSocket, since UDPServerSocket provides Bind. | 218 // UDPClientSocket, since UDPServerSocket provides Bind. |
| 212 DatagramSocket::BindType bind_type_; | 219 DatagramSocket::BindType bind_type_; |
| 213 | 220 |
| 214 // PRNG function for generating port numbers. | 221 // PRNG function for generating port numbers. |
| 215 RandIntCallback rand_int_cb_; | 222 RandIntCallback rand_int_cb_; |
| 216 | 223 |
| 217 // These are mutable since they're just cached copies to make | 224 // These are mutable since they're just cached copies to make |
| 218 // GetPeerAddress/GetLocalAddress smarter. | 225 // GetPeerAddress/GetLocalAddress smarter. |
| 219 mutable scoped_ptr<IPEndPoint> local_address_; | 226 mutable scoped_ptr<IPEndPoint> local_address_; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 237 CompletionCallback write_callback_; | 244 CompletionCallback write_callback_; |
| 238 | 245 |
| 239 BoundNetLog net_log_; | 246 BoundNetLog net_log_; |
| 240 | 247 |
| 241 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); | 248 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); |
| 242 }; | 249 }; |
| 243 | 250 |
| 244 } // namespace net | 251 } // namespace net |
| 245 | 252 |
| 246 #endif // NET_UDP_UDP_SOCKET_WIN_H_ | 253 #endif // NET_UDP_UDP_SOCKET_WIN_H_ |
| OLD | NEW |