13#include <boost/asio/io_context.hpp>
36 template <
typename InternalEPType,
typename ExternalEPType>
38 boost::asio::io_context &io_context,
47 template <
typename InternalEPType>
49 boost::asio::io_context &io_context,
57 template <
typename... EPArgs>
58 explicit Server(boost::asio::io_context &io_context, EPArgs &&... args)
63 return _server.GetLocalEndpoint();
83 _server.SetSynchronousMode(is_synchro);
111 auto on_session_opened = [
this](
auto session) {
117 auto on_session_closed = [
this](
auto session) {
121 _server.Listen(on_session_opened, on_session_closed);
Keeps the mapping between streams and sessions.
void DeregisterSession(std::shared_ptr< Session > session)
carla::streaming::Stream MakeStream()
bool RegisterSession(std::shared_ptr< Session > session)
void DisableForROS(stream_id_type sensor_id)
bool IsEnabledForROS(stream_id_type sensor_id)
void CloseStream(carla::streaming::detail::stream_id_type id)
void EnableForROS(stream_id_type sensor_id)
token_type GetToken(stream_id_type sensor_id)
静态断言,用于确保token_data结构体的大小与Token::data的大小相同。
一个低级的流媒体服务器。每个新流都有一个关联的令牌, 客户端可以使用这个令牌来订阅流。此服务器需要外部 io_context 运行。
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
void EnableForROS(stream_id sensor_id)
Positive time duration up to milliseconds resolution.
uint32_t stream_id_type
流ID的类型定义。
static auto make_endpoint(boost::asio::ip::basic_endpoint< Protocol > ep)
static void log_debug(Args &&... args)