6 #ifndef KAGOME_CORE_API_TRANSPORT_LISTENER_HPP 7 #define KAGOME_CORE_API_TRANSPORT_LISTENER_HPP 9 #include <boost/asio/ip/tcp.hpp> 23 using Acceptor = boost::asio::ip::tcp::acceptor;
24 using Endpoint = boost::asio::ip::tcp::endpoint;
26 std::function<void(const std::shared_ptr<Session> &)>;
39 endpoint.address(boost::asio::ip::address_v4::any());
56 virtual bool start() = 0;
62 virtual void stop() = 0;
74 #endif // KAGOME_CORE_API_TRANSPORT_LISTENER_IMPL_HPP
virtual bool start()=0
Start handling inner connection.
boost::asio::ip::tcp::acceptor Acceptor
server which listens for incoming connection, accepts connections making session from socket ...
std::function< void(const std::shared_ptr< Session > &)> NewSessionHandler
Endpoint endpoint
listening endpoint
virtual bool prepare()=0
Bind endpoint.
virtual void setHandlerForNewSession(NewSessionHandler &&on_new_session)=0
Set handler for working new session.
virtual void acceptOnce()=0
Accept incoming connection.
virtual void stop()=0
Stop working.
boost::asio::ip::tcp::endpoint Endpoint
uint32_t ws_max_connections
max allowed simultaneous connections through websocket
virtual ~Listener()=default