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_POSIX_H_ | 5 #ifndef NET_UDP_UDP_SOCKET_POSIX_H_ |
6 #define NET_UDP_UDP_SOCKET_POSIX_H_ | 6 #define NET_UDP_UDP_SOCKET_POSIX_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 const CompletionCallback& callback); | 112 const CompletionCallback& callback); |
113 | 113 |
114 // Sets the receive buffer size (in bytes) for the socket. | 114 // Sets the receive buffer size (in bytes) for the socket. |
115 // Returns a net error code. | 115 // Returns a net error code. |
116 int SetReceiveBufferSize(int32_t size); | 116 int SetReceiveBufferSize(int32_t size); |
117 | 117 |
118 // Sets the send buffer size (in bytes) for the socket. | 118 // Sets the send buffer size (in bytes) for the socket. |
119 // Returns a net error code. | 119 // Returns a net error code. |
120 int SetSendBufferSize(int32_t size); | 120 int SetSendBufferSize(int32_t size); |
121 | 121 |
122 // If supported by the platform, configures the socket to set the DF | |
123 // (Do not Fragment) bit on packets, which prevents routers from fragmenting | |
124 // them. Also, for IPv6, it prevents hosts from fragmenting them. | |
mmenke
2016/08/12 19:46:06
See other comment.
Ryan Hamilton
2016/08/12 21:46:02
Done.
| |
125 int SetDoNotFragment(); | |
mmenke
2016/08/12 19:46:06
Should we actually call these in tests?
Ryan Hamilton
2016/08/12 21:46:02
Good point. Done.
| |
126 | |
122 // Returns true if the socket is already connected or bound. | 127 // Returns true if the socket is already connected or bound. |
123 bool is_connected() const { return is_connected_; } | 128 bool is_connected() const { return is_connected_; } |
124 | 129 |
125 const BoundNetLog& NetLog() const { return net_log_; } | 130 const BoundNetLog& NetLog() const { return net_log_; } |
126 | 131 |
127 // Sets corresponding flags in |socket_options_| to allow the socket | 132 // Sets corresponding flags in |socket_options_| to allow the socket |
128 // to share the local address to which the socket will be bound with | 133 // to share the local address to which the socket will be bound with |
129 // other processes. Should be called between Open() and Bind(). | 134 // other processes. Should be called between Open() and Bind(). |
130 // Returns a net error code. | 135 // Returns a net error code. |
131 int AllowAddressReuse(); | 136 int AllowAddressReuse(); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 | 317 |
313 // Network that this socket is bound to via BindToNetwork(). | 318 // Network that this socket is bound to via BindToNetwork(). |
314 NetworkChangeNotifier::NetworkHandle bound_network_; | 319 NetworkChangeNotifier::NetworkHandle bound_network_; |
315 | 320 |
316 DISALLOW_COPY_AND_ASSIGN(UDPSocketPosix); | 321 DISALLOW_COPY_AND_ASSIGN(UDPSocketPosix); |
317 }; | 322 }; |
318 | 323 |
319 } // namespace net | 324 } // namespace net |
320 | 325 |
321 #endif // NET_UDP_UDP_SOCKET_POSIX_H_ | 326 #endif // NET_UDP_UDP_SOCKET_POSIX_H_ |
OLD | NEW |