camcom 1.0.0-pre2
 
Loading...
Searching...
No Matches
httplib::sse::SSEClient Class Reference

#include <httplib.h>

Public Types

using MessageHandler = std::function<void(const SSEMessage &)>
 
using ErrorHandler = std::function<void(Error)>
 
using OpenHandler = std::function<void()>
 

Public Member Functions

 SSEClient (Client &client, const std::string &path)
 
 SSEClient (Client &client, const std::string &path, const Headers &headers)
 
 ~SSEClient ()
 
 SSEClient (const SSEClient &)=delete
 
SSEClientoperator= (const SSEClient &)=delete
 
SSEClienton_message (MessageHandler handler)
 
SSEClienton_event (const std::string &type, MessageHandler handler)
 
SSEClienton_open (OpenHandler handler)
 
SSEClienton_error (ErrorHandler handler)
 
SSEClientset_reconnect_interval (int ms)
 
SSEClientset_max_reconnect_attempts (int n)
 
SSEClientset_headers (const Headers &headers)
 
bool is_connected () const
 
const std::string & last_event_id () const
 
void start ()
 
void start_async ()
 
void stop ()
 

Member Typedef Documentation

◆ ErrorHandler

using httplib::sse::SSEClient::ErrorHandler = std::function<void(Error)>

◆ MessageHandler

using httplib::sse::SSEClient::MessageHandler = std::function<void(const SSEMessage &)>

◆ OpenHandler

using httplib::sse::SSEClient::OpenHandler = std::function<void()>

Constructor & Destructor Documentation

◆ SSEClient() [1/3]

httplib::sse::SSEClient::SSEClient ( Client & client,
const std::string & path )
inline

◆ SSEClient() [2/3]

httplib::sse::SSEClient::SSEClient ( Client & client,
const std::string & path,
const Headers & headers )
inline

◆ ~SSEClient()

httplib::sse::SSEClient::~SSEClient ( )
inline

◆ SSEClient() [3/3]

httplib::sse::SSEClient::SSEClient ( const SSEClient & )
delete

Member Function Documentation

◆ is_connected()

bool httplib::sse::SSEClient::is_connected ( ) const
inline

◆ last_event_id()

const std::string & httplib::sse::SSEClient::last_event_id ( ) const
inline

◆ on_error()

SSEClient & httplib::sse::SSEClient::on_error ( ErrorHandler handler)
inline

◆ on_event()

SSEClient & httplib::sse::SSEClient::on_event ( const std::string & type,
MessageHandler handler )
inline

◆ on_message()

SSEClient & httplib::sse::SSEClient::on_message ( MessageHandler handler)
inline

◆ on_open()

SSEClient & httplib::sse::SSEClient::on_open ( OpenHandler handler)
inline

◆ operator=()

SSEClient & httplib::sse::SSEClient::operator= ( const SSEClient & )
delete

◆ set_headers()

SSEClient & httplib::sse::SSEClient::set_headers ( const Headers & headers)
inline

◆ set_max_reconnect_attempts()

SSEClient & httplib::sse::SSEClient::set_max_reconnect_attempts ( int n)
inline

◆ set_reconnect_interval()

SSEClient & httplib::sse::SSEClient::set_reconnect_interval ( int ms)
inline

◆ start()

void httplib::sse::SSEClient::start ( )
inline

◆ start_async()

void httplib::sse::SSEClient::start_async ( )
inline

◆ stop()

void httplib::sse::SSEClient::stop ( )
inline

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