Nebula
Loading...
Searching...
No Matches
Http::HttpClientRegistry Class Reference

#include <httpclientregistry.h>

Detailed Description

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< HttpClientObtainConnection (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::StringGetClassName () 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, Connectionconnections
 
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)
 

Constructor & Destructor Documentation

◆ HttpClientRegistry()

Http::HttpClientRegistry::HttpClientRegistry ( )

constructor

◆ ~HttpClientRegistry()

Http::HttpClientRegistry::~HttpClientRegistry ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

Http::HttpClientRegistry::__DeclareClass ( HttpClientRegistry )
private

◆ __DeclareSingleton()

Http::HttpClientRegistry::__DeclareSingleton ( HttpClientRegistry )
private

◆ Discard()

void Http::HttpClientRegistry::Discard ( )

discard the client registry, closes all open connections

◆ DisconnectIdle()

void Http::HttpClientRegistry::DisconnectIdle ( )

disconnect all connections with a zero use count

This disconnects all connections with a use count of 0.

◆ IsConnected()

bool Http::HttpClientRegistry::IsConnected ( const IO::URI & uri) const

check if a connection to an HTTP server exists

◆ IsValid()

bool Http::HttpClientRegistry::IsValid ( ) const
inline

return true if the object has been setup

◆ ObtainConnection()

Ptr< HttpClient > Http::HttpClientRegistry::ObtainConnection ( const IO::URI & uri)

open a connection to a HTTP server, reuse connection if already connected

◆ ReleaseConnection()

void Http::HttpClientRegistry::ReleaseConnection ( const IO::URI & uri)

give up connection to a HTTP server, this will NEVER disconnect!

◆ Setup()

void Http::HttpClientRegistry::Setup ( )

setup the client registry

Member Data Documentation

◆ connections

Util::Dictionary<Util::StringAtom, Connection> Http::HttpClientRegistry::connections
private

◆ isValid

bool Http::HttpClientRegistry::isValid
private

The documentation for this class was generated from the following files: