17 #include <boost/asio/deadline_timer.hpp> 18 #include <boost/asio/io_context.hpp> 19 #include <boost/asio/ip/tcp.hpp> 20 #include <boost/asio/strand.hpp> 32 :
public std::enable_shared_from_this<Primary>,
40 boost::asio::io_context &io_context,
53 template <
typename... Buffers>
57 "This function only accepts arguments of type BufferView.");
58 return std::make_shared<const carla::streaming::detail::tcp::Message>(buffers...);
62 void Write(std::shared_ptr<const carla::streaming::detail::tcp::Message> message);
65 void Write(std::string text);
71 template <
typename... Buffers>
72 void Write(Buffers... buffers) {
83 void CloseNow(boost::system::error_code ec = boost::system::error_code());
std::function< void(std::shared_ptr< Primary >, carla::Buffer)> callback_function_type_response
boost::asio::io_context::strand _strand
std::function< void(std::shared_ptr< Primary >)> callback_function_type
static auto MakeMessage(Buffers... buffers)
This file contains definitions of common data structures used in traffic manager. ...
void Write(Buffers... buffers)
Writes some data to the socket.
void Close()
Post a job to close the session.
std::shared_ptr< BufferPool > _buffer_pool
void CloseNow(boost::system::error_code ec=boost::system::error_code())
Primary(boost::asio::io_context &io_context, time_duration timeout, Listener &server)
boost::asio::deadline_timer _deadline
Listener::callback_function_type _on_closed
Positive time duration up to milliseconds resolution.
Inherit (privately) to suppress copy/move construction and assignment.
boost::asio::ip::tcp::socket socket_type
Listener::callback_function_type_response _on_response
void Write(std::shared_ptr< const carla::streaming::detail::tcp::Message > message)
Writes some data to the socket.
void Open(Listener::callback_function_type on_opened, Listener::callback_function_type on_closed, Listener::callback_function_type_response on_response)
Starts the session and calls on_opened after successfully reading the stream id, and on_closed once t...