Switchboard SDK
Loading...
Searching...
No Matches
switchboard::NetworkClient Class Referenceabstract
Inheritance diagram for switchboard::NetworkClient:
switchboard::CURLNetworkClient

Public Member Functions

virtual int post (const std::string &url, const std::vector< std::string > &headers, const std::string &body)=0
 
virtual NetworkResponseprocess ()=0
 
virtual unsigned int getNumberOfPendingRequests ()=0
 

Member Function Documentation

◆ getNumberOfPendingRequests()

virtual unsigned int switchboard::NetworkClient::getNumberOfPendingRequests ( )
pure virtual

Returns the number of pending requests.

Returns
The number of pending requests.

Implemented in switchboard::CURLNetworkClient.

◆ post()

virtual int switchboard::NetworkClient::post ( const std::string & url,
const std::vector< std::string > & headers,
const std::string & body )
pure virtual

Adds a post request to the queue.

Parameters
urlThe request url.
headersThe headers of the request.
bodyThe body of the request.
Returns
The id of the request, or 0 if the request could not be created.

Implemented in switchboard::CURLNetworkClient.

◆ process()

virtual NetworkResponse * switchboard::NetworkClient::process ( )
pure virtual

Processes currently active network requests in the queue. Should be periodically called from a single thread.

Returns
The response for last finished network request, nullptr if there is none.

Implemented in switchboard::CURLNetworkClient.