Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: net/udp/udp_socket_win.h

Issue 217573002: make SetReceiveBufferSize and SetSendBufferSize return net error codes (instead of bools) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo on Linux Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 bool SetReceiveBufferSize(int32 size); 98 // Returns a net error code.
99 int SetReceiveBufferSize(int32 size);
99 100
100 // Set the send buffer size (in bytes) for the socket. 101 // Set the send buffer size (in bytes) for the socket.
101 bool SetSendBufferSize(int32 size); 102 // Returns a net error code.
103 int SetSendBufferSize(int32 size);
102 104
103 // Returns true if the socket is already connected or bound. 105 // Returns true if the socket is already connected or bound.
104 bool is_connected() const { return socket_ != INVALID_SOCKET; } 106 bool is_connected() const { return socket_ != INVALID_SOCKET; }
105 107
106 const BoundNetLog& NetLog() const { return net_log_; } 108 const BoundNetLog& NetLog() const { return net_log_; }
107 109
108 // Sets corresponding flags in |socket_options_| to allow the socket 110 // Sets corresponding flags in |socket_options_| to allow the socket
109 // to share the local address to which the socket will be bound with 111 // to share the local address to which the socket will be bound with
110 // other processes. Should be called before Bind(). 112 // other processes. Should be called before Bind().
111 void AllowAddressReuse(); 113 void AllowAddressReuse();
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 CompletionCallback write_callback_; 256 CompletionCallback write_callback_;
255 257
256 BoundNetLog net_log_; 258 BoundNetLog net_log_;
257 259
258 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); 260 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin);
259 }; 261 };
260 262
261 } // namespace net 263 } // namespace net
262 264
263 #endif // NET_UDP_UDP_SOCKET_WIN_H_ 265 #endif // NET_UDP_UDP_SOCKET_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698