Kagome
Polkadot Runtime Engine in C++17
kagome::api::HttpListenerImpl Class Reference

server which listens for incoming connection, accepts connections making session from socket More...

#include <http_listener_impl.hpp>

Inheritance diagram for kagome::api::HttpListenerImpl:
Collaboration diagram for kagome::api::HttpListenerImpl:

Public Types

using SessionImpl = HttpSession
 
- Public Types inherited from kagome::api::Listener
using Context = RpcContext
 

Public Member Functions

 HttpListenerImpl (const std::shared_ptr< application::AppStateManager > &app_state_manager, std::shared_ptr< Context > context, Configuration listener_config, SessionImpl::Configuration session_config)
 
 ~HttpListenerImpl () 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< Contextcontext_
 
const Configuration config_
 
const SessionImpl::Configuration session_config_
 
std::unique_ptr< Acceptoracceptor_
 
std::unique_ptr< NewSessionHandleron_new_session_
 
std::shared_ptr< SessionImplnew_session_
 
log::Logger logger_
 

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 > &)>
 

Detailed Description

server which listens for incoming connection, accepts connections making session from socket

Definition at line 23 of file http_listener_impl.hpp.

Member Typedef Documentation

Constructor & Destructor Documentation

kagome::api::HttpListenerImpl::HttpListenerImpl ( const std::shared_ptr< application::AppStateManager > &  app_state_manager,
std::shared_ptr< Context context,
Configuration  listener_config,
SessionImpl::Configuration  session_config 
)

Definition at line 15 of file http_listener_impl.cpp.

kagome::api::HttpListenerImpl::~HttpListenerImpl ( )
overridedefault

Member Function Documentation

void kagome::api::HttpListenerImpl::acceptOnce ( )
overrideprivatevirtual

Accept incoming connection.

Implements kagome::api::Listener.

Definition at line 78 of file http_listener_impl.cpp.

bool kagome::api::HttpListenerImpl::prepare ( )
overridevirtual
See also
AppStateManager::takeControl

Implements kagome::api::Listener.

Definition at line 28 of file http_listener_impl.cpp.

void kagome::api::HttpListenerImpl::setHandlerForNewSession ( NewSessionHandler &&  on_new_session)
overridevirtual

Set handler for working new session.

Implements kagome::api::Listener.

Definition at line 72 of file http_listener_impl.cpp.

bool kagome::api::HttpListenerImpl::start ( )
overridevirtual
See also
AppStateManager::takeControl

Implements kagome::api::Listener.

Definition at line 50 of file http_listener_impl.cpp.

void kagome::api::HttpListenerImpl::stop ( )
overridevirtual
See also
AppStateManager::takeControl

Implements kagome::api::Listener.

Definition at line 66 of file http_listener_impl.cpp.

Member Data Documentation

std::unique_ptr<Acceptor> kagome::api::HttpListenerImpl::acceptor_
private

Definition at line 55 of file http_listener_impl.hpp.

const Configuration kagome::api::HttpListenerImpl::config_
private

Definition at line 52 of file http_listener_impl.hpp.

std::shared_ptr<Context> kagome::api::HttpListenerImpl::context_
private

Definition at line 51 of file http_listener_impl.hpp.

log::Logger kagome::api::HttpListenerImpl::logger_
private

Definition at line 60 of file http_listener_impl.hpp.

std::shared_ptr<SessionImpl> kagome::api::HttpListenerImpl::new_session_
private

Definition at line 58 of file http_listener_impl.hpp.

std::unique_ptr<NewSessionHandler> kagome::api::HttpListenerImpl::on_new_session_
private

Definition at line 56 of file http_listener_impl.hpp.

const SessionImpl::Configuration kagome::api::HttpListenerImpl::session_config_
private

Definition at line 53 of file http_listener_impl.hpp.


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