13#include <boost/asio/io_context.hpp>
14#include <boost/asio/ip/tcp.hpp>
15#include <boost/asio/post.hpp>
29 using endpoint = boost::asio::ip::tcp::endpoint;
47 template <
typename FunctorT1,
typename FunctorT2>
48 void Listen(FunctorT1 on_session_opened, FunctorT2 on_session_closed) {
52 std::move(on_session_opened),
53 std::move(on_session_closed));
Inherit (privately) to suppress copy/move construction and assignment.
std::function< void(std::shared_ptr< ServerSession >)> callback_function_type
endpoint::protocol_type protocol_type
bool IsSynchronousMode() const
boost::asio::io_context & _io_context
void SetTimeout(time_duration timeout)
Set session time-out.
boost::asio::ip::tcp::endpoint endpoint
endpoint GetLocalEndpoint() const
void OpenSession(time_duration timeout, ServerSession::callback_function_type on_session_opened, ServerSession::callback_function_type on_session_closed)
void Listen(FunctorT1 on_session_opened, FunctorT2 on_session_closed)
Start listening for connections.
Server(boost::asio::io_context &io_context, endpoint ep)
std::atomic< time_duration > _timeout
boost::asio::ip::tcp::acceptor _acceptor
void SetSynchronousMode(bool is_synchro)
Positive time duration up to milliseconds resolution.
This file contains definitions of common data structures used in traffic manager.