SRS-control 0.1.4
Loading...
Searching...
No Matches
srs::connection::FecCommandSocket Class Reference

#include <FecSwitchSocket.hpp>

Collaboration diagram for srs::connection::FecCommandSocket:

Public Types

using SmallConnection = CommandBase
using ConnectionType = SmallConnection

Public Member Functions

auto get_strand () -> auto &
auto get_time_us () const -> auto
void launch_actions ()
Public Member Functions inherited from srs::connection::SpecialSocket
void register_send_action (this auto &&self, asio::awaitable< void > action, const std::shared_ptr< typename std::remove_cvref_t< decltype(self)>::ConnectionType > &connection)
void listen (this auto &self, io_context_type &io_context)
auto is_valid () const -> bool
auto cancel_listen_after (this auto &&self, io_context_type &io_context, std::chrono::seconds waiting_time=std::chrono::seconds(2)) -> std::future< void >
auto wait_for_listen_finish (std::chrono::seconds time) -> std::optional< std::future_status >
auto get_socket () const -> auto &
auto get_port () const
auto get_socket_error_code () const -> auto
auto get_future () -> auto &

Private Types

using SmallConnections = std::vector<std::shared_ptr<SmallConnection>>
using ActionType = decltype(asio::co_spawn(strand_, asio::awaitable<void>(), asio::deferred))

Private Member Functions

void register_send_action_imp (asio::awaitable< void > action, const std::shared_ptr< SmallConnection > &connection)
auto get_response_msg_buffer () -> auto &
auto is_finished () -> bool
void print_error () const
void response_handler (const UDPEndpoint &endpoint, std::span< char > response)
 FecCommandSocket (int port_number, io_context_type &io_context)
void deregister_connection (const UDPEndpoint &endpoint, std::span< char > response, SmallConnections &connections)
void print_available_responses () const

Private Attributes

friend SpecialSocket
asio::strand< io_context_type::executor_type > strand_
std::mutex mut_
std::map< UDPEndpoint, SmallConnectionsall_connections_
std::vector< char > read_msg_buffer_
std::chrono::time_point< std::chrono::steady_clock > start_time_ = std::chrono::steady_clock::now()
std::vector< ActionTypeaction_queue_

Additional Inherited Members

Static Public Member Functions inherited from srs::connection::SpecialSocket
template<SpecialSocketDerived SocketType, typename... Args>
static auto create (int port_number, io_context_type &io_context, Args... args) -> std::expected< std::shared_ptr< SocketType >, boost::system::error_code >
Protected Member Functions inherited from srs::connection::SpecialSocket
 SpecialSocket (int port_number, io_context_type &io_context)
auto get_cancel_timer () -> auto &

Detailed Description

Definition at line 24 of file FecSwitchSocket.hpp.

Member Typedef Documentation

◆ ActionType

using srs::connection::FecCommandSocket::ActionType = decltype(asio::co_spawn(strand_, asio::awaitable<void>(), asio::deferred))
private

Definition at line 48 of file FecSwitchSocket.hpp.

◆ ConnectionType

◆ SmallConnection

◆ SmallConnections

using srs::connection::FecCommandSocket::SmallConnections = std::vector<std::shared_ptr<SmallConnection>>
private

Definition at line 41 of file FecSwitchSocket.hpp.

Constructor & Destructor Documentation

◆ FecCommandSocket()

srs::connection::FecCommandSocket::FecCommandSocket ( int port_number,
io_context_type & io_context )
explicitprivate

Definition at line 50 of file FecSwitchSocket.cpp.

Member Function Documentation

◆ deregister_connection()

void srs::connection::FecCommandSocket::deregister_connection ( const UDPEndpoint & endpoint,
std::span< char > response,
SmallConnections & connections )
private

Definition at line 81 of file FecSwitchSocket.cpp.

◆ get_response_msg_buffer()

auto srs::connection::FecCommandSocket::get_response_msg_buffer ( ) ->auto &
inlineprivate

Definition at line 52 of file FecSwitchSocket.hpp.

◆ get_strand()

auto srs::connection::FecCommandSocket::get_strand ( ) ->auto &
inline

Definition at line 31 of file FecSwitchSocket.hpp.

◆ get_time_us()

auto srs::connection::FecCommandSocket::get_time_us ( ) const->auto
inline

Definition at line 32 of file FecSwitchSocket.hpp.

◆ is_finished()

auto srs::connection::FecCommandSocket::is_finished ( ) ->bool
private

Definition at line 156 of file FecSwitchSocket.cpp.

◆ launch_actions()

void srs::connection::FecCommandSocket::launch_actions ( )

Definition at line 74 of file FecSwitchSocket.cpp.

◆ print_available_responses()

void srs::connection::FecCommandSocket::print_available_responses ( ) const
private

Definition at line 116 of file FecSwitchSocket.cpp.

◆ print_error()

void srs::connection::FecCommandSocket::print_error ( ) const
private

Definition at line 126 of file FecSwitchSocket.cpp.

◆ register_send_action_imp()

void srs::connection::FecCommandSocket::register_send_action_imp ( asio::awaitable< void > action,
const std::shared_ptr< SmallConnection > & connection )
private

Definition at line 58 of file FecSwitchSocket.cpp.

◆ response_handler()

void srs::connection::FecCommandSocket::response_handler ( const UDPEndpoint & endpoint,
std::span< char > response )
private

Definition at line 140 of file FecSwitchSocket.cpp.

Member Data Documentation

◆ action_queue_

std::vector<ActionType> srs::connection::FecCommandSocket::action_queue_
private

Definition at line 49 of file FecSwitchSocket.hpp.

◆ all_connections_

std::map<UDPEndpoint, SmallConnections> srs::connection::FecCommandSocket::all_connections_
private

Definition at line 44 of file FecSwitchSocket.hpp.

◆ mut_

std::mutex srs::connection::FecCommandSocket::mut_
private

Definition at line 43 of file FecSwitchSocket.hpp.

◆ read_msg_buffer_

std::vector<char> srs::connection::FecCommandSocket::read_msg_buffer_
private

Definition at line 45 of file FecSwitchSocket.hpp.

◆ SpecialSocket

friend srs::connection::FecCommandSocket::SpecialSocket
private

Definition at line 40 of file FecSwitchSocket.hpp.

◆ start_time_

std::chrono::time_point<std::chrono::steady_clock> srs::connection::FecCommandSocket::start_time_ = std::chrono::steady_clock::now()
private

Definition at line 46 of file FecSwitchSocket.hpp.

◆ strand_

asio::strand<io_context_type::executor_type> srs::connection::FecCommandSocket::strand_
private

Definition at line 42 of file FecSwitchSocket.hpp.


The documentation for this class was generated from the following files: