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());
Inherit (privately) to suppress copy/move construction and assignment.
std::function< void(std::shared_ptr< Primary >)> callback_function_type
std::function< void(std::shared_ptr< Primary >, carla::Buffer)> callback_function_type_response
boost::asio::deadline_timer _deadline
void Write(Buffers... buffers)
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...
std::shared_ptr< BufferPool > _buffer_pool
Listener::callback_function_type _on_closed
Primary(boost::asio::io_context &io_context, time_duration timeout, Listener &server)
boost::asio::io_context::strand _strand
static auto MakeMessage(Buffers... buffers)
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 CloseNow(boost::system::error_code ec=boost::system::error_code())
void Close()
Post a job to close the session.
Positive time duration up to milliseconds resolution.
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< BufferView > SharedBufferView