|
Nebula
|
#include <httpclientregistry.h>
The HttpClientRegistry provides a way to re-use existing connections to HTTP servers instead of setting up a HTTP connection for every single HTTP request.
Inherits Core::RefCounted.
Classes | |
| struct | Connection |
Public Member Functions | |
| HttpClientRegistry () | |
| constructor | |
| virtual | ~HttpClientRegistry () |
| destructor | |
| void | Setup () |
| setup the client registry | |
| void | Discard () |
| discard the client registry, closes all open connections | |
| bool | IsValid () const |
| return true if the object has been setup | |
| Ptr< HttpClient > | ObtainConnection (const IO::URI &uri) |
| open a connection to a HTTP server, reuse connection if already connected | |
| void | ReleaseConnection (const IO::URI &uri) |
| give up connection to a HTTP server, this will NEVER disconnect! | |
| bool | IsConnected (const IO::URI &uri) const |
| check if a connection to an HTTP server exists | |
| void | DisconnectIdle () |
| disconnect all connections with a zero use count | |
Public Member Functions inherited from Core::RefCounted | |
| RefCounted () | |
| constructor | |
| int | GetRefCount () const |
| get the current refcount | |
| void | AddRef () |
| increment refcount by one | |
| void | Release () |
| decrement refcount and destroy object if refcount is zero | |
| bool | IsInstanceOf (const Rtti &rtti) const |
| return true if this object is instance of given class | |
| bool | IsInstanceOf (const Util::String &className) const |
| return true if this object is instance of given class by string | |
| bool | IsInstanceOf (const Util::FourCC &classFourCC) const |
| return true if this object is instance of given class by fourcc | |
| bool | IsA (const Rtti &rtti) const |
| return true if this object is instance of given class, or a derived class | |
| bool | IsA (const Util::String &rttiName) const |
| return true if this object is instance of given class, or a derived class, by string | |
| bool | IsA (const Util::FourCC &rttiFourCC) const |
| return true if this object is instance of given class, or a derived class, by fourcc | |
| const Util::String & | GetClassName () const |
| get the class name | |
| Util::FourCC | GetClassFourCC () const |
| get the class FourCC code | |
Private Member Functions | |
| __DeclareClass (HttpClientRegistry) | |
| __DeclareSingleton (HttpClientRegistry) | |
Private Attributes | |
| Util::Dictionary< Util::StringAtom, Connection > | connections |
| bool | isValid |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::RefCounted | |
| static void | DumpRefCountingLeaks () |
| dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!) | |
Protected Member Functions inherited from Core::RefCounted | |
| virtual | ~RefCounted () |
| destructor (called when refcount reaches zero) | |
| Http::HttpClientRegistry::HttpClientRegistry | ( | ) |
constructor
|
virtual |
destructor
|
private |
|
private |
| void Http::HttpClientRegistry::Discard | ( | ) |
discard the client registry, closes all open connections
| void Http::HttpClientRegistry::DisconnectIdle | ( | ) |
disconnect all connections with a zero use count
This disconnects all connections with a use count of 0.
| bool Http::HttpClientRegistry::IsConnected | ( | const IO::URI & | uri | ) | const |
check if a connection to an HTTP server exists
|
inline |
return true if the object has been setup
| Ptr< HttpClient > Http::HttpClientRegistry::ObtainConnection | ( | const IO::URI & | uri | ) |
open a connection to a HTTP server, reuse connection if already connected
| void Http::HttpClientRegistry::ReleaseConnection | ( | const IO::URI & | uri | ) |
give up connection to a HTTP server, this will NEVER disconnect!
| void Http::HttpClientRegistry::Setup | ( | ) |
setup the client registry
|
private |
|
private |