diff options
author | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-21 18:46:00 +0000 |
---|---|---|
committer | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-21 18:46:00 +0000 |
commit | 241c5c2c0e223f9bf3f5f38661d21c0a46bdfe59 (patch) | |
tree | eb7b4d038bb311c094b3d882e4ac9ec52876bb5a /net/socket/client_socket_pool.cc | |
parent | 8974e04c6ef2c9fe849e17a4b2224d1b51f4001c (diff) | |
download | chromium_src-241c5c2c0e223f9bf3f5f38661d21c0a46bdfe59.zip chromium_src-241c5c2c0e223f9bf3f5f38661d21c0a46bdfe59.tar.gz chromium_src-241c5c2c0e223f9bf3f5f38661d21c0a46bdfe59.tar.bz2 |
A/B test for determining a value for unused socket timeout. Currently the
timeout defaults to 10 seconds. Having this value set too low won't allow us
to take advantage of idle sockets. Setting it to too high could possibly
result in more ERR_CONNECT_RESETs, requiring one RTT to receive the RST packet
and possibly another RTT to re-establish the connection.
r=jar
Review URL: http://codereview.chromium.org/2827016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool.cc')
-rw-r--r-- | net/socket/client_socket_pool.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/net/socket/client_socket_pool.cc b/net/socket/client_socket_pool.cc new file mode 100644 index 0000000..4cefe8d --- /dev/null +++ b/net/socket/client_socket_pool.cc @@ -0,0 +1,29 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/socket/client_socket_pool.h"
+
+namespace {
+
+// The maximum duration, in seconds, to keep used idle persistent sockets
+// alive.
+// TODO(ziadh): Change this timeout after getting histogram data on how long it
+// should be.
+int g_unused_idle_socket_timeout = 10;
+
+} // namespace
+
+namespace net {
+
+// static
+int ClientSocketPool::unused_idle_socket_timeout() {
+ return g_unused_idle_socket_timeout;
+}
+
+// static
+void ClientSocketPool::set_unused_idle_socket_timeout(int timeout) {
+ g_unused_idle_socket_timeout = timeout;
+}
+
+} // namespace net
|