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 // Requests that packets sent by this socket not be fragment, either locally |
| 123 // by the host, or by routers (via the DF bit in the IPv4 packet header). |
| 124 // May not be supported by all platforms. Returns a return a network error |
| 125 // code if there was a problem, but the socket will still be usable. Can not |
| 126 // return ERR_IO_PENDING. |
| 127 int SetDoNotFragment(); |
| 128 |
122 // Returns true if the socket is already connected or bound. | 129 // Returns true if the socket is already connected or bound. |
123 bool is_connected() const { return is_connected_; } | 130 bool is_connected() const { return is_connected_; } |
124 | 131 |
125 const BoundNetLog& NetLog() const { return net_log_; } | 132 const BoundNetLog& NetLog() const { return net_log_; } |
126 | 133 |
127 // Sets corresponding flags in |socket_options_| to allow the socket | 134 // Sets corresponding flags in |socket_options_| to allow the socket |
128 // to share the local address to which the socket will be bound with | 135 // to share the local address to which the socket will be bound with |
129 // other processes. Should be called between Open() and Bind(). | 136 // other processes. Should be called between Open() and Bind(). |
130 // Returns a net error code. | 137 // Returns a net error code. |
131 int AllowAddressReuse(); | 138 int AllowAddressReuse(); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 319 |
313 // Network that this socket is bound to via BindToNetwork(). | 320 // Network that this socket is bound to via BindToNetwork(). |
314 NetworkChangeNotifier::NetworkHandle bound_network_; | 321 NetworkChangeNotifier::NetworkHandle bound_network_; |
315 | 322 |
316 DISALLOW_COPY_AND_ASSIGN(UDPSocketPosix); | 323 DISALLOW_COPY_AND_ASSIGN(UDPSocketPosix); |
317 }; | 324 }; |
318 | 325 |
319 } // namespace net | 326 } // namespace net |
320 | 327 |
321 #endif // NET_UDP_UDP_SOCKET_POSIX_H_ | 328 #endif // NET_UDP_UDP_SOCKET_POSIX_H_ |
OLD | NEW |