srs-control
0.2.2
Toggle main menu visibility
Loading...
Searching...
No Matches
DataSocket.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
srs/Application.hpp
"
4
#include "
srs/connections/ConnectionBase.hpp
"
5
#include "
srs/connections/ConnectionTypeDef.hpp
"
6
#include "
srs/connections/SpecialSocketBase.hpp
"
7
#include "
srs/data/BufferQueue.hpp
"
8
#include "
srs/data/LargeBuffer.hpp
"
9
#include "
srs/utils/CommonAlias.hpp
"
10
#include "
srs/utils/CommonDefinitions.hpp
"
11
#include <asio/awaitable.hpp>
12
#include <cstddef>
13
#include <gsl/gsl-lite.hpp>
14
#include <memory>
15
#include <span>
16
17
namespace
srs::connection
18
{
22
class
DataSocket
:
public
SpecialSocket
23
{
24
public
:
25
using
ConnectionType
=
CommandBase
;
26
30
void
cancel
();
31
void
before_socket_close
();
32
33
private
:
34
friend
SpecialSocket
;
35
std::size_t
buffer_size_
=
common::LARGE_READ_MSG_BUFFER_SIZE
;
36
LargeBuffer
read_msg_buffer_
;
37
gsl::not_null<io_context_type*>
io_context_
;
38
gsl::not_null<workflow::AnalysisHandle*>
workflow_handler_
;
39
BufferQueue::Token
token_
;
40
41
void
register_send_action_imp
(asio::awaitable<void> action,
const
std::shared_ptr<ConnectionType>&
connection
);
42
auto
get_response_msg_buffer
() -> std::span<char> {
return
read_msg_buffer_
.get_all_data(); }
43
void
response_handler
(
const
UDPEndpoint
& endpoint, std::size_t read_size);
44
static
auto
is_finished
() ->
bool
{
return
false
; };
45
static
void
print_error
() {};
46
47
DataSocket
(
int
port_number,
48
io_context_type
& io_context,
49
std::size_t buffer_size,
50
workflow::AnalysisHandle
&
workflow
);
51
};
52
}
// namespace srs::connection
Application.hpp
BufferQueue.hpp
CommonAlias.hpp
CommonDefinitions.hpp
ConnectionBase.hpp
ConnectionTypeDef.hpp
LargeBuffer.hpp
SpecialSocketBase.hpp
srs::BufferQueue::Token
std::pair< moodycamel::ProducerToken, moodycamel::ConsumerToken > Token
A queue token type used for enqueue and dequeue action. The token type consists of one producer token...
Definition
BufferQueue.hpp:41
srs::LargeBuffer
Class for buffer for storing large data.
Definition
LargeBuffer.hpp:23
srs::connection::CommandBase
Definition
ConnectionBase.hpp:27
srs::connection::DataSocket::token_
BufferQueue::Token token_
Definition
DataSocket.hpp:39
srs::connection::DataSocket::read_msg_buffer_
LargeBuffer read_msg_buffer_
Definition
DataSocket.hpp:36
srs::connection::DataSocket::DataSocket
DataSocket(int port_number, io_context_type &io_context, std::size_t buffer_size, workflow::AnalysisHandle &workflow)
Definition
DataSocket.cpp:17
srs::connection::DataSocket::SpecialSocket
friend SpecialSocket
Definition
DataSocket.hpp:34
srs::connection::DataSocket::io_context_
gsl::not_null< io_context_type * > io_context_
Definition
DataSocket.hpp:37
srs::connection::DataSocket::before_socket_close
void before_socket_close()
Definition
DataSocket.cpp:51
srs::connection::DataSocket::register_send_action_imp
void register_send_action_imp(asio::awaitable< void > action, const std::shared_ptr< ConnectionType > &connection)
Definition
DataSocket.cpp:31
srs::connection::DataSocket::ConnectionType
CommandBase ConnectionType
Definition
DataSocket.hpp:25
srs::connection::DataSocket::response_handler
void response_handler(const UDPEndpoint &endpoint, std::size_t read_size)
Definition
DataSocket.cpp:37
srs::connection::DataSocket::workflow_handler_
gsl::not_null< workflow::AnalysisHandle * > workflow_handler_
Definition
DataSocket.hpp:38
srs::connection::DataSocket::get_response_msg_buffer
auto get_response_msg_buffer() -> std::span< char >
Definition
DataSocket.hpp:42
srs::connection::DataSocket::cancel
void cancel()
Cancel reading the data from the UDP socket.
Definition
DataSocket.cpp:44
srs::connection::DataSocket::buffer_size_
std::size_t buffer_size_
Definition
DataSocket.hpp:35
srs::connection::DataSocket::print_error
static void print_error()
Definition
DataSocket.hpp:45
srs::connection::DataSocket::is_finished
static auto is_finished() -> bool
Definition
DataSocket.hpp:44
srs::workflow::AnalysisHandle
Definition
AnalysisHandle.hpp:30
srs::common::LARGE_READ_MSG_BUFFER_SIZE
constexpr auto LARGE_READ_MSG_BUFFER_SIZE
size of the data array for reading a UDP package
Definition
CommonDefinitions.hpp:21
srs::connection
Definition
Application.hpp:34
srs::connection::UDPEndpoint
asio::ip::basic_endpoint< asio::ip::udp > UDPEndpoint
Definition
ConnectionTypeDef.hpp:17
srs::workflow
Definition
Application.hpp:29
srs::io_context_type
asio::thread_pool io_context_type
Definition
CommonAlias.hpp:12
backend
srs
connections
DataSocket.hpp
Impressum
Datenschutzerklärung
Generated by
1.17.0