Kagome
Polkadot Runtime Engine in C++17
|
server which listens for incoming connection, accepts connections making session from socket More...
#include <ws_listener_impl.hpp>
Public Types | |
using | SessionImpl = WsSession |
Public Types inherited from kagome::api::Listener | |
using | Context = RpcContext |
Public Member Functions | |
WsListenerImpl (const std::shared_ptr< application::AppStateManager > &app_state_manager, std::shared_ptr< Context > context, Configuration listener_config, SessionImpl::Configuration session_config) | |
~WsListenerImpl () override=default | |
bool | prepare () override |
bool | start () override |
void | stop () override |
void | setHandlerForNewSession (NewSessionHandler &&on_new_session) override |
Set handler for working new session. More... | |
Public Member Functions inherited from kagome::api::Listener | |
virtual | ~Listener ()=default |
Private Member Functions | |
void | acceptOnce () override |
Accept incoming connection. More... | |
Private Attributes | |
std::shared_ptr< Context > | context_ |
const Configuration | config_ |
const SessionImpl::Configuration | session_config_ |
const uint32_t | max_ws_connections_ |
std::unique_ptr< Acceptor > | acceptor_ |
std::unique_ptr< NewSessionHandler > | on_new_session_ |
std::atomic< Session::SessionId > | next_session_id_ |
std::shared_ptr< SessionImpl > | new_session_ |
std::atomic< uint32_t > | active_connections_ |
metrics::RegistryPtr | registry_ = metrics::createRegistry() |
metrics::Counter * | opened_session_ |
metrics::Counter * | closed_session_ |
log::Logger | log_ |
Additional Inherited Members | |
Protected Types inherited from kagome::api::Listener | |
using | Acceptor = boost::asio::ip::tcp::acceptor |
using | Endpoint = boost::asio::ip::tcp::endpoint |
using | NewSessionHandler = std::function< void(const std::shared_ptr< Session > &)> |
server which listens for incoming connection, accepts connections making session from socket
Definition at line 26 of file ws_listener_impl.hpp.
Definition at line 29 of file ws_listener_impl.hpp.
kagome::api::WsListenerImpl::WsListenerImpl | ( | const std::shared_ptr< application::AppStateManager > & | app_state_manager, |
std::shared_ptr< Context > | context, | ||
Configuration | listener_config, | ||
SessionImpl::Configuration | session_config | ||
) |
Definition at line 18 of file ws_listener_impl.cpp.
|
overridedefault |
|
overrideprivatevirtual |
Accept incoming connection.
Implements kagome::api::Listener.
Definition at line 95 of file ws_listener_impl.cpp.
|
overridevirtual |
Implements kagome::api::Listener.
Definition at line 45 of file ws_listener_impl.cpp.
|
overridevirtual |
Set handler for working new session.
Implements kagome::api::Listener.
Definition at line 89 of file ws_listener_impl.cpp.
|
overridevirtual |
Implements kagome::api::Listener.
Definition at line 67 of file ws_listener_impl.cpp.
|
overridevirtual |
Implements kagome::api::Listener.
Definition at line 83 of file ws_listener_impl.cpp.
|
private |
Definition at line 58 of file ws_listener_impl.hpp.
|
private |
Definition at line 63 of file ws_listener_impl.hpp.
|
private |
Definition at line 68 of file ws_listener_impl.hpp.
|
private |
Definition at line 54 of file ws_listener_impl.hpp.
|
private |
Definition at line 53 of file ws_listener_impl.hpp.
|
private |
Definition at line 70 of file ws_listener_impl.hpp.
|
private |
Definition at line 56 of file ws_listener_impl.hpp.
|
private |
Definition at line 62 of file ws_listener_impl.hpp.
|
private |
Definition at line 61 of file ws_listener_impl.hpp.
|
private |
Definition at line 59 of file ws_listener_impl.hpp.
|
private |
Definition at line 67 of file ws_listener_impl.hpp.
|
private |
Definition at line 66 of file ws_listener_impl.hpp.
|
private |
Definition at line 55 of file ws_listener_impl.hpp.