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

#include <DataSocket.hpp>

Collaboration diagram for srs::connection::DataSocket:

Public Types

using ConnectionType = CommandBase

Public Member Functions

void set_buffer_size (std::size_t buffer_size)
void cancel ()
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 Member Functions

void register_send_action_imp (asio::awaitable< void > action, const std::shared_ptr< ConnectionType > &connection)
auto get_response_msg_buffer () -> auto &
void response_handler (const UDPEndpoint &endpoint, std::span< char > response)
 DataSocket (int port_number, io_context_type &io_context, workflow::Handler *workflow)

Static Private Member Functions

static auto is_finished () -> bool
static void print_error ()

Private Attributes

friend SpecialSocket
std::vector< char > read_msg_buffer_
gsl::not_null< io_context_type * > io_context_
gsl::not_null< workflow::Handler * > workflow_handler_

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 17 of file DataSocket.hpp.

Member Typedef Documentation

◆ ConnectionType

Constructor & Destructor Documentation

◆ DataSocket()

srs::connection::DataSocket::DataSocket ( int port_number,
io_context_type & io_context,
workflow::Handler * workflow )
private

Definition at line 17 of file DataSocket.cpp.

Member Function Documentation

◆ cancel()

void srs::connection::DataSocket::cancel ( )

Definition at line 39 of file DataSocket.cpp.

◆ get_response_msg_buffer()

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

Definition at line 31 of file DataSocket.hpp.

◆ is_finished()

auto srs::connection::DataSocket::is_finished ( ) ->bool
inlinestaticprivate

Definition at line 33 of file DataSocket.hpp.

◆ print_error()

void srs::connection::DataSocket::print_error ( )
inlinestaticprivate

Definition at line 34 of file DataSocket.hpp.

◆ register_send_action_imp()

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

Definition at line 28 of file DataSocket.cpp.

◆ response_handler()

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

Definition at line 34 of file DataSocket.cpp.

◆ set_buffer_size()

void srs::connection::DataSocket::set_buffer_size ( std::size_t buffer_size)

Definition at line 25 of file DataSocket.cpp.

Member Data Documentation

◆ io_context_

gsl::not_null<io_context_type*> srs::connection::DataSocket::io_context_
private

Definition at line 27 of file DataSocket.hpp.

◆ read_msg_buffer_

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

Definition at line 26 of file DataSocket.hpp.

◆ SpecialSocket

friend srs::connection::DataSocket::SpecialSocket
private

Definition at line 25 of file DataSocket.hpp.

◆ workflow_handler_

gsl::not_null<workflow::Handler*> srs::connection::DataSocket::workflow_handler_
private

Definition at line 28 of file DataSocket.hpp.


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