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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 const CompletionCallback& callback); | 117 const CompletionCallback& callback); |
118 | 118 |
119 // Sets the receive buffer size (in bytes) for the socket. | 119 // Sets the receive buffer size (in bytes) for the socket. |
120 // Returns a net error code. | 120 // Returns a net error code. |
121 int SetReceiveBufferSize(int32_t size); | 121 int SetReceiveBufferSize(int32_t size); |
122 | 122 |
123 // Sets the send buffer size (in bytes) for the socket. | 123 // Sets the send buffer size (in bytes) for the socket. |
124 // Returns a net error code. | 124 // Returns a net error code. |
125 int SetSendBufferSize(int32_t size); | 125 int SetSendBufferSize(int32_t size); |
126 | 126 |
| 127 // Configures the socket to set the DF (Do not Fragment) bit on packets, |
| 128 // which prevents routers from fragmenting them. Also, for IPv6, it |
| 129 // prevents hosts from fragmenting them. Returns a return a network error |
| 130 // code if there was a problem, but the socket will still be usable. Can |
| 131 // not return ERR_IO_PENDING. |
| 132 int SetDoNotFragment(); |
| 133 |
127 // Returns true if the socket is already connected or bound. | 134 // Returns true if the socket is already connected or bound. |
128 bool is_connected() const { return is_connected_; } | 135 bool is_connected() const { return is_connected_; } |
129 | 136 |
130 const BoundNetLog& NetLog() const { return net_log_; } | 137 const BoundNetLog& NetLog() const { return net_log_; } |
131 | 138 |
132 // Sets corresponding flags in |socket_options_| to allow the socket | 139 // Sets corresponding flags in |socket_options_| to allow the socket |
133 // 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 |
134 // other processes. Should be called between Open() and Bind(). | 141 // other processes. Should be called between Open() and Bind(). |
135 // Returns a net error code. | 142 // Returns a net error code. |
136 int AllowAddressReuse(); | 143 int AllowAddressReuse(); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 SetFlowFn set_flow_func_; | 379 SetFlowFn set_flow_func_; |
373 | 380 |
374 FRIEND_TEST_ALL_PREFIXES(UDPSocketTest, SetDSCPFake); | 381 FRIEND_TEST_ALL_PREFIXES(UDPSocketTest, SetDSCPFake); |
375 DISALLOW_COPY_AND_ASSIGN(QwaveAPI); | 382 DISALLOW_COPY_AND_ASSIGN(QwaveAPI); |
376 }; | 383 }; |
377 | 384 |
378 | 385 |
379 } // namespace net | 386 } // namespace net |
380 | 387 |
381 #endif // NET_UDP_UDP_SOCKET_WIN_H_ | 388 #endif // NET_UDP_UDP_SOCKET_WIN_H_ |
OLD | NEW |