|
SNode.C
|
#include <EventSource.h>
Classes | |
| struct | Config |
Public Types | |
| using | MasterRequest = typename Client::MasterRequest |
| using | Request = typename Client::Request |
| using | Response = typename Client::Response |
| using | SocketConnection = typename Client::SocketConnection |
Public Types inherited from web::http::client::tools::EventSource | |
| enum class | ReadyState : int { CONNECTING = 0 , OPEN = 1 , CLOSED = 2 } |
Public Member Functions | |
| EventSourceT (const EventSourceT &)=delete | |
| EventSourceT & | operator= (const EventSourceT &)=delete |
| EventSourceT (EventSourceT &&) noexcept=delete | |
| EventSourceT & | operator= (EventSourceT &&) noexcept=delete |
| void | close () override |
Public Member Functions inherited from web::http::client::tools::EventSource | |
| 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) |
Protected Member Functions | |
| EventSourceT () | |
| void | init (const std::string &url) |
Protected Member Functions inherited from web::http::client::tools::EventSource | |
| EventSource () | |
Static Private Member Functions | |
| static bool | digits (std::string_view maybeDigitsAsString) |
| static uint32_t | parseU32 (std::string_view uint32AsString) |
| static void | deliverMessage (const std::shared_ptr< SharedState > &sharedState, const std::string &evType, const std::string &payload, const std::string &evId) |
| static void | dispatch (const std::shared_ptr< SharedState > &sharedState) |
| static void | processLine (const std::shared_ptr< SharedState > &sharedState, const std::shared_ptr< Config > &sharedConfig, std::string_view line) |
| static void | parse (const std::shared_ptr< SharedState > &sharedState, const std::shared_ptr< Config > &sharedConfig) |
Private Attributes | |
| std::shared_ptr< Client > | client |
| SocketConnection * | socketConnection = nullptr |
| std::shared_ptr< Config > | sharedConfig |
Additional Inherited Members | |
Protected Attributes inherited from web::http::client::tools::EventSource | |
| std::shared_ptr< SharedState > | sharedState |
Definition at line 124 of file EventSource.h.
| using web::http::client::tools::EventSourceT< Client >::MasterRequest = typename Client::MasterRequest |
Definition at line 128 of file EventSource.h.
| using web::http::client::tools::EventSourceT< Client >::Request = typename Client::Request |
Definition at line 129 of file EventSource.h.
| using web::http::client::tools::EventSourceT< Client >::Response = typename Client::Response |
Definition at line 130 of file EventSource.h.
| using web::http::client::tools::EventSourceT< Client >::SocketConnection = typename Client::SocketConnection |
Definition at line 131 of file EventSource.h.
|
delete |
|
deletenoexcept |
|
inlineprotected |
Definition at line 276 of file EventSource.h.
References web::http::client::tools::EventSourceT< Client >::sharedConfig.
|
inlineoverridevirtual |
Implements web::http::client::tools::EventSource.
Definition at line 415 of file EventSource.h.
References web::http::client::tools::EventSourceT< Client >::sharedConfig, and web::http::client::tools::EventSourceT< Client >::socketConnection.
|
inlinestaticprivate |
Definition at line 161 of file EventSource.h.
References web::http::client::tools::EventSource::SharedState::onEventListener, web::http::client::tools::EventSource::SharedState::onMessageListener, and web::http::client::tools::EventSource::SharedState::origin.
Referenced by web::http::client::tools::EventSourceT< Client >::dispatch().
|
inlinestaticprivate |
Definition at line 138 of file EventSource.h.
Referenced by web::http::client::tools::EventSourceT< Client >::processLine().
|
inlinestaticprivate |
Definition at line 181 of file EventSource.h.
References web::http::client::tools::EventSource::SharedState::data, web::http::client::tools::EventSourceT< Client >::deliverMessage(), web::http::client::tools::EventSource::SharedState::idBuf, web::http::client::tools::EventSource::SharedState::lastId, and web::http::client::tools::EventSource::SharedState::type.
Referenced by web::http::client::tools::EventSourceT< Client >::processLine().
|
inlineprotected |
Definition at line 280 of file EventSource.h.
References web::http::client::tools::EventSourceT< Client >::client, web::http::client::tools::EventSource::CLOSED, web::http::client::tools::EventSource::CONNECTING, core::socket::State::DISABLED, core::socket::State::ERROR, core::socket::State::FATAL, web::http::client::tools::EventSource::SharedState::host, core::socket::State::OK, web::http::client::tools::EventSource::OPEN, web::http::client::tools::EventSource::SharedState::origin, web::http::client::tools::EventSourceT< Client >::parse(), web::http::client::tools::EventSource::SharedState::path, web::http::client::tools::EventSource::SharedState::port, web::http::client::tools::EventSource::SharedState::scheme, web::http::client::tools::EventSourceT< Client >::sharedConfig, web::http::client::tools::EventSource::sharedState, core::socket::SocketAddress::toString(), and core::socket::State::what().
Referenced by web::http::legacy::in::EventSource::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().
|
delete |
|
deletenoexcept |
|
inlinestaticprivate |
Definition at line 242 of file EventSource.h.
References web::http::client::tools::EventSource::SharedState::pending, and web::http::client::tools::EventSourceT< Client >::processLine().
Referenced by web::http::client::tools::EventSourceT< Client >::init().
|
inlinestaticprivate |
Definition at line 148 of file EventSource.h.
Referenced by web::http::client::tools::EventSourceT< Client >::processLine().
|
inlinestaticprivate |
Definition at line 199 of file EventSource.h.
References web::http::client::tools::EventSource::SharedState::data, web::http::client::tools::EventSourceT< Client >::digits(), web::http::client::tools::EventSourceT< Client >::dispatch(), web::http::client::tools::EventSource::SharedState::idBuf, web::http::client::tools::EventSourceT< Client >::parseU32(), web::http::client::tools::EventSource::SharedState::retry, and web::http::client::tools::EventSource::SharedState::type.
Referenced by web::http::client::tools::EventSourceT< Client >::parse().
|
private |
Definition at line 425 of file EventSource.h.
Referenced by web::http::client::tools::EventSourceT< Client >::init().
|
private |
Definition at line 427 of file EventSource.h.
Referenced by web::http::client::tools::EventSourceT< Client >::close(), web::http::client::tools::EventSourceT< Client >::EventSourceT(), and web::http::client::tools::EventSourceT< Client >::init().
|
private |
Definition at line 426 of file EventSource.h.
Referenced by web::http::client::tools::EventSourceT< Client >::close().