Module: Internet Protocols Module Package: HTTP
Does not inherit
closeIfNotUsedSince() getMaxConnectionsPerHost() getMaxThreads() |
PointerType registerScheme() RWHttpClientManager() |
setMaxConnectionsPerHost() setMaxThreads() unregisterScheme() |
RWHttpClientManager provides a resource for pooling connection requests for RWHttpAgent. The RWHttpClientManager is thread-hot, allowing for multiple requests to be processed simultaneously.
Additionally, RWHttpClientManager provides a mechanism for reusing connected clients for multiple requests to the same host.
RWHttpClientManager();
Constructs a default RWHttpClientManager. The client manager maintains a pool of 20 threads for executing HTTP requests, and allows a maximum of 2 connections to any host (as recommended by the HTTP specification).
RWHttpClientManager(size_t maxConnections, size_t maxThreads);
Constructs an RWHttpClientManager instance with a pool containing maxThreads threads, and with a limit of maxConnections connections to any host. A maxConnections value of 0 indicates that there is no limit on the number of connections.
typedef RWTCountingPointer<RWHttpClient,RWSafeCounter> PointerType;
void setMaxThreads(size_t maxThreads);
Sets the maximum number of threads that can be created by the client manager.
size_t getMaxThreads() const;
Returns the value for the maximum number of threads that can be created by the client manager.
void setMaxConnectionsPerHost(size_t maxConn);
Sets the maximum number of clients allowed to connect to a host. If this value is set to 0, there is no limit on the number of connections.
size_t getMaxConnectionsPerHost() const;
Returns the value for the maximum number of clients allowed to connect to a host.
void closeIfNotUsedSince(const RWHttpDate& date);
Closes all connections that not have not been used since date.
bool registerScheme(const RWCString& scheme, RWTFunctorR0<RWHttpClient> functor);
Registers a new URL scheme with the client manager. The functor object functor should return an RWHttpClient instance that can correctly handle requests of the associated scheme.
If the specified scheme has already been registered with this instance, the new functor is ignored the method returns false; otherwise, the method returns true.
By default, the only scheme registered with an RWHttpClientManager is "http".
bool unregisterScheme(const RWCString& scheme);
Unregisters the specified URL scheme from the client manager. If the specified scheme is not registered with the client manager instance, the method returns false; otherwise, the scheme is removed and the method returns true.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.