Kagome
Polkadot Runtime Engine in C++17
kagome::api::Listener Class Referenceabstract

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

#include <listener.hpp>

Inheritance diagram for kagome::api::Listener:
Collaboration diagram for kagome::api::Listener:

Classes

struct  Configuration
 

Public Types

using Context = RpcContext
 

Public Member Functions

virtual ~Listener ()=default
 
virtual bool prepare ()=0
 Bind endpoint. More...
 
virtual bool start ()=0
 Start handling inner connection. More...
 
virtual void stop ()=0
 Stop working. More...
 
virtual void setHandlerForNewSession (NewSessionHandler &&on_new_session)=0
 Set handler for working new session. More...
 

Protected Types

using Acceptor = boost::asio::ip::tcp::acceptor
 
using Endpoint = boost::asio::ip::tcp::endpoint
 
using NewSessionHandler = std::function< void(const std::shared_ptr< Session > &)>
 

Protected Member Functions

virtual void acceptOnce ()=0
 Accept incoming connection. More...
 

Detailed Description

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

Definition at line 21 of file listener.hpp.

Member Typedef Documentation

using kagome::api::Listener::Acceptor = boost::asio::ip::tcp::acceptor
protected

Definition at line 23 of file listener.hpp.

Definition at line 29 of file listener.hpp.

using kagome::api::Listener::Endpoint = boost::asio::ip::tcp::endpoint
protected

Definition at line 24 of file listener.hpp.

using kagome::api::Listener::NewSessionHandler = std::function<void(const std::shared_ptr<Session> &)>
protected

Definition at line 26 of file listener.hpp.

Constructor & Destructor Documentation

virtual kagome::api::Listener::~Listener ( )
virtualdefault

Member Function Documentation

virtual void kagome::api::Listener::acceptOnce ( )
protectedpure virtual

Accept incoming connection.

Implemented in kagome::api::WsListenerImpl, and kagome::api::HttpListenerImpl.

virtual bool kagome::api::Listener::prepare ( )
pure virtual

Bind endpoint.

See also
AppStateManager::takeControl

Implemented in kagome::api::WsListenerImpl, and kagome::api::HttpListenerImpl.

virtual void kagome::api::Listener::setHandlerForNewSession ( NewSessionHandler &&  on_new_session)
pure virtual

Set handler for working new session.

Implemented in kagome::api::WsListenerImpl, and kagome::api::HttpListenerImpl.

virtual bool kagome::api::Listener::start ( )
pure virtual

Start handling inner connection.

See also
AppStateManager::takeControl

Implemented in kagome::api::WsListenerImpl, and kagome::api::HttpListenerImpl.

virtual void kagome::api::Listener::stop ( )
pure virtual

Stop working.

See also
AppStateManager::takeControl

Implemented in kagome::api::WsListenerImpl, and kagome::api::HttpListenerImpl.


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