| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // |callback| is the user callback function to call on complete. | 88 // |callback| is the user callback function to call on complete. |
| 89 // Returns a net error code, or ERR_IO_PENDING if the IO is in progress. | 89 // Returns a net error code, or ERR_IO_PENDING if the IO is in progress. |
| 90 // If ERR_IO_PENDING is returned, the caller must keep |buf| and |address| | 90 // If ERR_IO_PENDING is returned, the caller must keep |buf| and |address| |
| 91 // alive until the callback is called. | 91 // alive until the callback is called. |
| 92 int SendTo(IOBuffer* buf, | 92 int SendTo(IOBuffer* buf, |
| 93 int buf_len, | 93 int buf_len, |
| 94 const IPEndPoint& address, | 94 const IPEndPoint& address, |
| 95 const CompletionCallback& callback); | 95 const CompletionCallback& callback); |
| 96 | 96 |
| 97 // Set the receive buffer size (in bytes) for the socket. | 97 // Set the receive buffer size (in bytes) for the socket. |
| 98 // Returns a net error code. | 98 bool SetReceiveBufferSize(int32 size); |
| 99 int SetReceiveBufferSize(int32 size); | |
| 100 | 99 |
| 101 // Set the send buffer size (in bytes) for the socket. | 100 // Set the send buffer size (in bytes) for the socket. |
| 102 // Returns a net error code. | 101 bool SetSendBufferSize(int32 size); |
| 103 int SetSendBufferSize(int32 size); | |
| 104 | 102 |
| 105 // Returns true if the socket is already connected or bound. | 103 // Returns true if the socket is already connected or bound. |
| 106 bool is_connected() const { return socket_ != INVALID_SOCKET; } | 104 bool is_connected() const { return socket_ != INVALID_SOCKET; } |
| 107 | 105 |
| 108 const BoundNetLog& NetLog() const { return net_log_; } | 106 const BoundNetLog& NetLog() const { return net_log_; } |
| 109 | 107 |
| 110 // Sets corresponding flags in |socket_options_| to allow the socket | 108 // Sets corresponding flags in |socket_options_| to allow the socket |
| 111 // to share the local address to which the socket will be bound with | 109 // to share the local address to which the socket will be bound with |
| 112 // other processes. Should be called before Bind(). | 110 // other processes. Should be called before Bind(). |
| 113 void AllowAddressReuse(); | 111 void AllowAddressReuse(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 CompletionCallback write_callback_; | 254 CompletionCallback write_callback_; |
| 257 | 255 |
| 258 BoundNetLog net_log_; | 256 BoundNetLog net_log_; |
| 259 | 257 |
| 260 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); | 258 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); |
| 261 }; | 259 }; |
| 262 | 260 |
| 263 } // namespace net | 261 } // namespace net |
| 264 | 262 |
| 265 #endif // NET_UDP_UDP_SOCKET_WIN_H_ | 263 #endif // NET_UDP_UDP_SOCKET_WIN_H_ |
| OLD | NEW |