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

Unified Diff: net/socket/tcp_client_socket_libevent.cc

Issue 199048: Add methods for setting socket buffers to the Socket (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/tcp_client_socket_libevent.h ('k') | net/socket/tcp_client_socket_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_client_socket_libevent.cc
===================================================================
--- net/socket/tcp_client_socket_libevent.cc (revision 25133)
+++ net/socket/tcp_client_socket_libevent.cc (working copy)
@@ -262,6 +262,23 @@
return ERR_IO_PENDING;
}
+bool TCPClientSocketLibevent::SetReceiveBufferSize(int32 size) {
+ int rv = setsockopt(socket_, SOL_SOCKET, SO_RCVBUF,
+ reinterpret_cast<const char*>(&size),
+ sizeof(size));
+ DCHECK(!rv) << "Could not set socket receive buffer size: " << errno;
+ return rv == 0;
+}
+
+bool TCPClientSocketLibevent::SetSendBufferSize(int32 size) {
+ int rv = setsockopt(socket_, SOL_SOCKET, SO_SNDBUF,
+ reinterpret_cast<const char*>(&size),
+ sizeof(size));
+ DCHECK(!rv) << "Could not set socket send buffer size: " << errno;
+ return rv == 0;
+}
+
+
int TCPClientSocketLibevent::CreateSocket(const addrinfo* ai) {
socket_ = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if (socket_ == kInvalidSocket)
« no previous file with comments | « net/socket/tcp_client_socket_libevent.h ('k') | net/socket/tcp_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698