#include <network/YiHTTPService.h>

Public Member Functions | |
| ~CYIHTTPService () | |
| void | SetMaxRedirects (uint32_t uMaxRedirects) |
| void | SetNetworkTimeoutMs (uint32_t uNetworkTimeoutMs) |
| void | SetConnectionTimeoutMs (uint32_t uConnectionTimeoutMs) |
| void | SetMaxConcurrentConnections (uint32_t uMaxConnections) |
| void | SetNetworkConfiguration (const CYINetworkConfiguration &networkConfiguration) |
| void | SetProxyUrl (const CYIUrl &proxyUrl) |
| void | Start () |
| void | Start (const CYINetworkConfiguration &networkConfiguration) |
| void | Stop () |
| std::shared_ptr< CYIHTTPResponse > | EnqueueRequest (const std::shared_ptr< CYIHTTPRequest > &pRequest) |
| void | CancelRequest (const std::shared_ptr< CYIHTTPRequest > &pRequest) |
| void | LogCacheItems () const |
| void | ClearCache () |
Public Member Functions inherited from CYISignalHandler | |
| CYISignalHandler () | |
| CYISignalHandler (const CYISignalHandler &rSignalHandler) | |
| virtual | ~CYISignalHandler () |
| CYISignalHandler & | operator= (const CYISignalHandler &rSignalHandler) |
| void | MoveToThread (CYIThread *pThread) |
| This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More... | |
| CYIThreadHandle | GetThreadAffinity () const |
| void | SetThreadAffinity (const CYIThreadHandle &rThreadAffinity) |
| virtual bool | IsConnected () const |
| virtual bool | IsConnected (const CYISignalBase &rSignal) const |
| void | Disconnect (CYISignalBase &rSignal) |
| void | DisconnectFromAllSignals () |
Public Member Functions inherited from CYIThread::Listener | |
| Listener () | |
| virtual | ~Listener () |
| virtual void | OnThreadStarted (CYIThread *) |
| virtual void | OnThreadTerminated (CYIThread *) |
| virtual void | OnThreadFinished (CYIThread *) |
Public Member Functions inherited from CYIScriptableObject | |
| CYIScriptableObject () | |
| CYIScriptableObject (const CYIScriptableObject &other) | |
| CYIScriptableObject & | operator= (const CYIScriptableObject &other) |
| virtual | ~CYIScriptableObject () |
| CYIBindingImplementation * | GetBindingImplementation () const |
| void | SetBindingImplementation (CYIBindingImplementation *pBindingImplementation) |
| virtual const CYIRuntimeTypeInfo * | GetRuntimeTypeInfoForScriptObject () const |
Static Public Member Functions | |
| static CYIHTTPService * | GetInstance () |
| static void | SetSSLRootCertificate (const CYIString &rPath) |
Public Attributes | |
| CYISignal | ServiceActive |
| CYISignal | ServiceInactive |
Friends | |
| class | CYIHTTPServicePriv |
| CYIHTTPService::~CYIHTTPService | ( | ) |
| void CYIHTTPService::CancelRequest | ( | const std::shared_ptr< CYIHTTPRequest > & | pRequest | ) |
Cancels the previously enqueued HTTP request.
| void CYIHTTPService::ClearCache | ( | ) |
Clears all cached responses.
| std::shared_ptr<CYIHTTPResponse> CYIHTTPService::EnqueueRequest | ( | const std::shared_ptr< CYIHTTPRequest > & | pRequest | ) |
Queues an HTTP Request for async processing. The result will be stored in the returned HTTP response when available.
Connect to NotifyResponse and NotifyError on pRequest to be notified when the response is ready, or the request failed.
Query the status of the response using the returned CYIHTTPResponse.
|
static |
| void CYIHTTPService::LogCacheItems | ( | ) | const |
Logs information about cached responses.
| void CYIHTTPService::SetConnectionTimeoutMs | ( | uint32_t | uConnectionTimeoutMs | ) |
Sets the maximum amount of time, in milliseconds, which the connection phase for a request may take. This is the time from when the request is dequeued and the transfer has started to when a response is received from the server.
Default is 30 seconds.
| void CYIHTTPService::SetMaxConcurrentConnections | ( | uint32_t | uMaxConnections | ) |
Sets the maximum number of requests that can be active concurrently. Once the maximum is reached requests will remain in a queue until a request completes.
| void CYIHTTPService::SetMaxRedirects | ( | uint32_t | uMaxRedirects | ) |
Sets the max number of redirects which the HTTP service will follow.
Default is 3.
| void CYIHTTPService::SetNetworkConfiguration | ( | const CYINetworkConfiguration & | networkConfiguration | ) |
Sets or modifies the network configuration settings. networkConfiguration allows you to to configure the underlying caches.
Modifying the network configuration after Start() has been called will only affect cache settings.
| void CYIHTTPService::SetNetworkTimeoutMs | ( | uint32_t | uNetworkTimeoutMs | ) |
Sets the maximum amount of time, in milliseconds, which a request may take. This is the time from when the request is dequeued and the transfer has started to when the transfer is complete.
Default is 60 seconds.
| void CYIHTTPService::SetProxyUrl | ( | const CYIUrl & | proxyUrl | ) |
Set the proxy that will be used for future HTTP requests. Setting the proxy url to an empty url will reset the proxy to use the system settings.
|
static |
Set the SSL root certificate for the network.
| void CYIHTTPService::Start | ( | ) |
Starts the service using the NetworkConfiguration provided by calling SetNetworkConfiguration().
Calling Start() before first calling SetNetworkConfiguration() will result in CYIHTTPService starting with default values for CYINetworkConfiguration::CYINetworkConfiguration. A default persistent cache will be created using the default data path if no cache path is provided.
The service does not accept requests until Start has been called.
| void CYIHTTPService::Start | ( | const CYINetworkConfiguration & | networkConfiguration | ) |
Start the service with the provided configuration settings. rNetworkConfiguration allows you to configure the underlying caches. A default persistent cache will be created using the default data path if no cache path is provided.
The service does not accept requests until Start has been called.
| void CYIHTTPService::Stop | ( | ) |
Stop the service. This is a destructive operation, and Start cannot be called to re-start the service.
The service does not accept requests once Stop has been called.
|
friend |
| CYISignal CYIHTTPService::ServiceActive |
Emitted when the service starts processing requests after a period of inactivity.
| CYISignal CYIHTTPService::ServiceInactive |
Emitted when the service has finished processing all queued requests.