SRS-control 0.1.4
Loading...
Searching...
No Matches
DataSocket.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "srs/Application.hpp"
8#include <boost/asio/awaitable.hpp>
9#include <cstddef>
10#include <gsl/gsl-lite.hpp>
11#include <memory>
12#include <span>
13#include <vector>
14
15namespace srs::connection
16{
18 {
19 public:
21 void set_buffer_size(std::size_t buffer_size);
22 void cancel();
23
24 private:
26 std::vector<char> read_msg_buffer_;
27 gsl::not_null<io_context_type*> io_context_;
28 gsl::not_null<workflow::Handler*> workflow_handler_;
29
30 void register_send_action_imp(asio::awaitable<void> action, const std::shared_ptr<ConnectionType>& connection);
31 auto get_response_msg_buffer() -> auto& { return read_msg_buffer_; }
32 void response_handler(const UDPEndpoint& endpoint, std::span<char> response);
33 static auto is_finished() -> bool { return false; };
34 static void print_error() {};
35
36 DataSocket(int port_number, io_context_type& io_context, workflow::Handler* workflow);
37 };
38} // namespace srs::connection
gsl::not_null< workflow::Handler * > workflow_handler_
DataSocket(int port_number, io_context_type &io_context, workflow::Handler *workflow)
gsl::not_null< io_context_type * > io_context_
void set_buffer_size(std::size_t buffer_size)
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)
std::vector< char > read_msg_buffer_
static auto is_finished() -> bool
boost::asio::ip::basic_endpoint< boost::asio::ip::udp > UDPEndpoint
asio::thread_pool io_context_type