Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::HttpClientOperation Struct Reference

One in-flight HTTP request/response operation. More...

#include <HttpClient.h>

Public Member Functions

 HttpClientOperation (const HttpClientOperation &)=delete
 
 HttpClientOperation (HttpClientOperation &&)=delete
 
HttpClientOperationoperator= (const HttpClientOperation &)=delete
 
HttpClientOperationoperator= (HttpClientOperation &&)=delete
 
Result init (HttpClient &client, const HttpClientOperationMemory &memory)
 
Result close ()
 
Result cancel ()
 
Result start (const HttpClientRequest &request, HttpClientResponse &response, HttpClientOperationListener *listener=nullptr, HttpClientRequestBodyProvider *bodyProvider=nullptr)
 Starts a new request on this operation.
 
Result poll (uint32_t timeoutMilliseconds=0)
 Processes queued backend events and optionally waits for more work.
 
void setNotifier (HttpClientOperationNotifier *notifierValue)
 Registers an optional notifier used by adapters such as HttpClientAsyncT.
 
bool isInitialized () const
 
bool isRequestInFlight () const
 

Friends

struct Internal
 
struct HttpClientAppleCallbacks
 
struct HttpClientLinuxCallbacks
 
struct HttpClientWindowsCallbacks
 

Detailed Description

One in-flight HTTP request/response operation.

Member Function Documentation

◆ poll()

Result SC::HttpClientOperation::poll ( uint32_t timeoutMilliseconds = 0)
nodiscard

Processes queued backend events and optionally waits for more work.

Parameters
timeoutMillisecondsMaximum time to wait for new events, 0 for non-blocking polling
Returns
Result(true) on success, otherwise the processing error

◆ setNotifier()

void SC::HttpClientOperation::setNotifier ( HttpClientOperationNotifier * notifierValue)
inline

Registers an optional notifier used by adapters such as HttpClientAsyncT.

Parameters
notifierValueNotifier receiving wake-up notifications, or nullptr

◆ start()

Result SC::HttpClientOperation::start ( const HttpClientRequest & request,
HttpClientResponse & response,
HttpClientOperationListener * listener = nullptr,
HttpClientRequestBodyProvider * bodyProvider = nullptr )
nodiscard

Starts a new request on this operation.

Parameters
requestRequest metadata
responseParsed response metadata storage updated as the request progresses
listenerOptional poll-driven response listener
bodyProviderOptional request body provider for streamed uploads
Returns
Result(true) on success, otherwise the start error

The documentation for this struct was generated from the following file: