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 <qos2.h> | 8 #include <qos2.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <winsock2.h> | 10 #include <winsock2.h> |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // Requests that packets sent by this socket not be fragment, either locally | 127 // Requests that packets sent by this socket not be fragment, either locally |
128 // by the host, or by routers (via the DF bit in the IPv4 packet header). | 128 // by the host, or by routers (via the DF bit in the IPv4 packet header). |
129 // May not be supported by all platforms. Returns a return a network error | 129 // May not be supported by all platforms. Returns a return a network error |
130 // code if there was a problem, but the socket will still be usable. Can not | 130 // code if there was a problem, but the socket will still be usable. Can not |
131 // return ERR_IO_PENDING. | 131 // return ERR_IO_PENDING. |
132 int SetDoNotFragment(); | 132 int SetDoNotFragment(); |
133 | 133 |
134 // Returns true if the socket is already connected or bound. | 134 // Returns true if the socket is already connected or bound. |
135 bool is_connected() const { return is_connected_; } | 135 bool is_connected() const { return is_connected_; } |
136 | 136 |
137 const BoundNetLog& NetLog() const { return net_log_; } | 137 const NetLogWithSource& NetLog() const { return net_log_; } |
138 | 138 |
139 // Sets corresponding flags in |socket_options_| to allow the socket | 139 // Sets corresponding flags in |socket_options_| to allow the socket |
140 // to share the local address to which the socket will be bound with | 140 // to share the local address to which the socket will be bound with |
141 // other processes. Should be called between Open() and Bind(). | 141 // other processes. Should be called between Open() and Bind(). |
142 // Returns a net error code. | 142 // Returns a net error code. |
143 int AllowAddressReuse(); | 143 int AllowAddressReuse(); |
144 | 144 |
145 // Sets corresponding flags in |socket_options_| to allow sending | 145 // Sets corresponding flags in |socket_options_| to allow sending |
146 // and receiving packets to and from broadcast addresses. | 146 // and receiving packets to and from broadcast addresses. |
147 int SetBroadcast(bool broadcast); | 147 int SetBroadcast(bool broadcast); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // Cached copy of the current address we're sending to, if any. Used for | 310 // Cached copy of the current address we're sending to, if any. Used for |
311 // logging. | 311 // logging. |
312 std::unique_ptr<IPEndPoint> send_to_address_; | 312 std::unique_ptr<IPEndPoint> send_to_address_; |
313 | 313 |
314 // External callback; called when read is complete. | 314 // External callback; called when read is complete. |
315 CompletionCallback read_callback_; | 315 CompletionCallback read_callback_; |
316 | 316 |
317 // External callback; called when write is complete. | 317 // External callback; called when write is complete. |
318 CompletionCallback write_callback_; | 318 CompletionCallback write_callback_; |
319 | 319 |
320 BoundNetLog net_log_; | 320 NetLogWithSource net_log_; |
321 | 321 |
322 // QWAVE data. Used to set DSCP bits on outgoing packets. | 322 // QWAVE data. Used to set DSCP bits on outgoing packets. |
323 HANDLE qos_handle_; | 323 HANDLE qos_handle_; |
324 QOS_FLOWID qos_flow_id_; | 324 QOS_FLOWID qos_flow_id_; |
325 | 325 |
326 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); | 326 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); |
327 }; | 327 }; |
328 | 328 |
329 //----------------------------------------------------------------------------- | 329 //----------------------------------------------------------------------------- |
330 | 330 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 SetFlowFn set_flow_func_; | 379 SetFlowFn set_flow_func_; |
380 | 380 |
381 FRIEND_TEST_ALL_PREFIXES(UDPSocketTest, SetDSCPFake); | 381 FRIEND_TEST_ALL_PREFIXES(UDPSocketTest, SetDSCPFake); |
382 DISALLOW_COPY_AND_ASSIGN(QwaveAPI); | 382 DISALLOW_COPY_AND_ASSIGN(QwaveAPI); |
383 }; | 383 }; |
384 | 384 |
385 | 385 |
386 } // namespace net | 386 } // namespace net |
387 | 387 |
388 #endif // NET_UDP_UDP_SOCKET_WIN_H_ | 388 #endif // NET_UDP_UDP_SOCKET_WIN_H_ |
OLD | NEW |