Index: net/socket/client_socket_pool_base.h |
=================================================================== |
--- net/socket/client_socket_pool_base.h (revision 90003) |
+++ net/socket/client_socket_pool_base.h (working copy) |
@@ -50,6 +50,13 @@ |
class ClientSocketHandle; |
+// Returns the client socket reuse policy. |
+int GetSocketReusePolicy(); |
+ |
+// Sets the client socket reuse policy. |
+// NOTE: 'policy' should be a valid ClientSocketReusePolicy enum value. |
M-A Ruel
2011/06/22 14:53:33
Then why isn't it a ClientSocketReusePolicy?
Why
gagansingh
2011/06/23 15:53:59
I'm avoiding an ugly looking if condition by assum
|
+NET_API void SetSocketReusePolicy(int policy); |
+ |
// ConnectJob provides an abstract interface for "connecting" a socket. |
// The connection may involve host resolution, tcp connection, ssl connection, |
// etc. |
@@ -167,6 +174,17 @@ |
NO_IDLE_SOCKETS = 0x1, // Do not return an idle socket. Create a new one. |
}; |
+ enum ClientSocketReusePolicy { |
+ // Socket with largest amount of bytes transferred. |
+ USE_WARMEST_SOCKET = 0, |
+ |
+ // Socket which scores highest on large bytes transferred and low idle time. |
+ USE_WARM_SOCKET = 1, |
+ |
+ // Socket which was most recently used. |
+ USE_LAST_ACCESSED_SOCKET = 2, |
+ }; |
+ |
class NET_TEST Request { |
public: |
Request(ClientSocketHandle* handle, |