Instrument Neutral Distributed Interface INDI 2.2.5
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
SSEClient & operator= (const SSEClient &)=delete
SSEClient & on_message (MessageHandler handler)
SSEClient & on_event (const std::string &type, MessageHandler handler)
SSEClient & on_open (OpenHandler handler)
SSEClient & on_error (ErrorHandler handler)
SSEClient & set_reconnect_interval (int ms)
SSEClient & set_max_reconnect_attempts (int n)
bool is_connected () const
const std::string & last_event_id () const
void start ()
void start_async ()
void stop ()

Detailed Description

Definition at line 3537 of file httplib.h.

Member Typedef Documentation

◆ ErrorHandler

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

Definition at line 3541 of file httplib.h.

◆ MessageHandler

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

Definition at line 3540 of file httplib.h.

◆ OpenHandler

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

Definition at line 3542 of file httplib.h.

Constructor & Destructor Documentation

◆ SSEClient() [1/3]

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

Definition at line 3544 of file httplib.h.

◆ SSEClient() [2/3]

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

Definition at line 3547 of file httplib.h.

◆ ~SSEClient()

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

Definition at line 3550 of file httplib.h.

◆ SSEClient() [3/3]

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

Member Function Documentation

◆ is_connected()

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

Definition at line 3596 of file httplib.h.

◆ last_event_id()

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

Definition at line 3600 of file httplib.h.

◆ on_error()

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

Definition at line 3577 of file httplib.h.

◆ on_event()

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

Definition at line 3565 of file httplib.h.

◆ on_message()

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

Definition at line 3559 of file httplib.h.

◆ on_open()

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

Definition at line 3571 of file httplib.h.

◆ operator=()

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

◆ set_max_reconnect_attempts()

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

Definition at line 3589 of file httplib.h.

◆ set_reconnect_interval()

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

Definition at line 3583 of file httplib.h.

◆ start()

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

Definition at line 3606 of file httplib.h.

◆ start_async()

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

Definition at line 3613 of file httplib.h.

◆ stop()

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

Definition at line 3623 of file httplib.h.


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