|
SNode.C
|
#include <EventSource.h>
Classes | |
| struct | MessageEvent |
| struct | SharedState |
Public Types | |
| enum class | ReadyState : int { CONNECTING = 0 , OPEN = 1 , CLOSED = 2 } |
Public Member Functions | |
| virtual | ~EventSource () |
| EventSource * | onMessage (std::function< void(const MessageEvent &)> messageCallback) |
| EventSource * | addEventListener (const std::string &key, std::function< void(const MessageEvent &)> eventListener) |
| EventSource * | removeEventListeners (const std::string &type) |
| EventSource * | onOpen (std::function< void()> onOpen) |
| EventSource * | onError (std::function< void()> onError) |
| EventSource::ReadyState | readyState () const |
| const std::string & | lastEventId () const |
| uint32_t | retry () const |
| EventSource * | retry (uint32_t retry) |
| virtual void | close ()=0 |
Protected Member Functions | |
| EventSource () | |
Protected Attributes | |
| std::shared_ptr< SharedState > | sharedState |
Definition at line 68 of file EventSource.h.
|
strong |
|
protected |
Definition at line 50 of file EventSource.cpp.
References sharedState.
|
virtual |
Reimplemented in web::http::legacy::in::EventSource, web::http::legacy::in6::EventSource, web::http::legacy::rc::EventSource, web::http::legacy::un::EventSource, web::http::tls::in::EventSource, web::http::tls::in6::EventSource, web::http::tls::rc::EventSource, and web::http::tls::un::EventSource.
Definition at line 54 of file EventSource.cpp.
| EventSource * web::http::client::tools::EventSource::addEventListener | ( | const std::string & | key, |
| std::function< void(const MessageEvent &)> | eventListener | ||
| ) |
Definition at line 63 of file EventSource.cpp.
References web::http::client::tools::EventSource::SharedState::onEventListener, and sharedState.
|
pure virtual |
Implemented in web::http::client::tools::EventSourceT< Client >, web::http::client::tools::EventSourceT< web::http::legacy::in6::Client >, web::http::client::tools::EventSourceT< web::http::legacy::in::Client >, web::http::client::tools::EventSourceT< web::http::legacy::rc::Client >, web::http::client::tools::EventSourceT< web::http::legacy::un::Client >, web::http::client::tools::EventSourceT< web::http::tls::in6::Client >, web::http::client::tools::EventSourceT< web::http::tls::in::Client >, web::http::client::tools::EventSourceT< web::http::tls::rc::Client >, and web::http::client::tools::EventSourceT< web::http::tls::un::Client >.
| const std::string & web::http::client::tools::EventSource::lastEventId | ( | ) | const |
Definition at line 91 of file EventSource.cpp.
References web::http::client::tools::EventSource::SharedState::lastId, and sharedState.
| EventSource * web::http::client::tools::EventSource::onError | ( | std::function< void()> | onError | ) |
Definition at line 81 of file EventSource.cpp.
References web::http::client::tools::EventSource::SharedState::onErrorListener, and sharedState.
| EventSource * web::http::client::tools::EventSource::onMessage | ( | std::function< void(const MessageEvent &)> | messageCallback | ) |
Definition at line 57 of file EventSource.cpp.
References web::http::client::tools::EventSource::SharedState::onMessageListener, and sharedState.
| EventSource * web::http::client::tools::EventSource::onOpen | ( | std::function< void()> | onOpen | ) |
Definition at line 75 of file EventSource.cpp.
References web::http::client::tools::EventSource::SharedState::onOpenListener, and sharedState.
| EventSource::ReadyState web::http::client::tools::EventSource::readyState | ( | ) | const |
Definition at line 87 of file EventSource.cpp.
References web::http::client::tools::EventSource::SharedState::ready, and sharedState.
| EventSource * web::http::client::tools::EventSource::removeEventListeners | ( | const std::string & | type | ) |
Definition at line 69 of file EventSource.cpp.
References web::http::client::tools::EventSource::SharedState::onEventListener, and sharedState.
| uint32_t web::http::client::tools::EventSource::retry | ( | ) | const |
Definition at line 95 of file EventSource.cpp.
References web::http::client::tools::EventSource::SharedState::retry, and sharedState.
| EventSource * web::http::client::tools::EventSource::retry | ( | uint32_t | retry | ) |
Definition at line 99 of file EventSource.cpp.
References web::http::client::tools::EventSource::SharedState::retry, and sharedState.
|
protected |
Definition at line 120 of file EventSource.h.
Referenced by addEventListener(), EventSource(), web::http::client::tools::EventSourceT< Client >::init(), lastEventId(), onError(), onMessage(), onOpen(), readyState(), removeEventListeners(), retry(), and retry().