13#include <boost/asio/io_context.hpp>
39 template <
typename InternalEPType,
typename ExternalEPType>
41 boost::asio::io_context &io_context,
49 template <
typename InternalEPType>
51 boost::asio::io_context &io_context,
58 template <
typename... EPArgs>
59 explicit Server(boost::asio::io_context &io_context, EPArgs &&... args)
63 return _server.GetLocalEndpoint();
79 _server.SetSynchronousMode(is_synchro);
127 auto on_session_opened = [
this](
auto session) {
132 auto on_session_closed = [
this](
auto session) {
136 _server.Listen(on_session_opened, on_session_closed);
Keeps the mapping between streams and sessions.
void SetSessionsUseStreamAliases(bool enabled)
When enabled, a session subscribes through an alias (see SetStreamAlias) and a stream id without an a...
void SetStreamAlias(stream_id_type alias, stream_id_type stream_id)
Routes sessions subscribing to alias to the local stream stream_id.
void DeregisterSession(std::shared_ptr< Session > session)
carla::streaming::Stream MakeStream()
std::optional< token_type > FindToken(stream_id_type stream_id)
Like GetToken(), but returns std::nullopt for an unknown stream_id instead of creating an empty strea...
bool RegisterSession(std::shared_ptr< Session > session)
void DisableForROS(stream_id_type sensor_id)
void SetROS2TopicVisibilityDefaultEnabled(bool enabled)
bool IsEnabledForROS(stream_id_type sensor_id)
std::optional< stream_id_type > FindStreamAlias(stream_id_type alias)
void CloseStream(carla::streaming::detail::stream_id_type id)
void RemoveStreamAlias(stream_id_type alias)
void EnableForROS(stream_id_type sensor_id)
token_type GetToken(stream_id_type sensor_id)
Serializes a stream endpoint.
A low-level streaming server.
Server(boost::asio::io_context &io_context, detail::EndPoint< protocol_type, InternalEPType > internal_ep, detail::EndPoint< protocol_type, ExternalEPType > external_ep)
detail::Dispatcher _dispatcher
void CloseStream(carla::streaming::detail::stream_id_type id)
void SetSynchronousMode(bool is_synchro)
carla::streaming::detail::stream_id_type stream_id
void SetTimeout(time_duration timeout)
void DisableForROS(stream_id sensor_id)
typename underlying_server::protocol_type protocol_type
token_type GetToken(stream_id sensor_id)
Server(boost::asio::io_context &io_context, EPArgs &&... args)
bool IsEnabledForROS(stream_id sensor_id)
Server(boost::asio::io_context &io_context, detail::EndPoint< protocol_type, InternalEPType > internal_ep)
underlying_server _server
underlying_server::endpoint GetLocalEndpoint() const
std::optional< stream_id > FindStreamAlias(stream_id alias)
void RemoveStreamAlias(stream_id alias)
std::optional< token_type > FindToken(stream_id id)
void EnableForROS(stream_id sensor_id)
void SetSessionsUseStreamAliases(bool enabled)
void SetROS2TopicVisibilityDefaultEnabled(bool enabled)
void SetStreamAlias(stream_id alias, stream_id target)
Positive time duration up to milliseconds resolution.
static auto make_endpoint(boost::asio::ip::basic_endpoint< Protocol > ep)
This file contains definitions of common data structures used in traffic manager.
static void log_debug(Args &&... args)