A TCP server session. 更多...
#include <primary.h>
Public 类型 | |
using | socket_type = boost::asio::ip::tcp::socket |
Public 成员函数 | |
void | Close () |
Post a job to close the session. | |
void | Open (Listener::callback_function_type on_opened, Listener::callback_function_type on_closed, Listener::callback_function_type_response on_response) |
Starts the session and calls on_opened after successfully reading the stream id, and on_closed once the session is closed. | |
Primary (boost::asio::io_context &io_context, time_duration timeout, Listener &server) | |
void | ReadData () |
read data | |
template<typename... Buffers> | |
void | Write (Buffers... buffers) |
Writes some data to the socket. | |
void | Write (std::shared_ptr< const carla::streaming::detail::tcp::Message > message) |
Writes some data to the socket. | |
void | Write (std::string text) |
Writes a string | |
~Primary () | |
静态 Public 成员函数 | |
template<typename... Buffers> | |
static auto | MakeMessage (Buffers... buffers) |
Private 成员函数 | |
void | CloseNow (boost::system::error_code ec=boost::system::error_code()) |
void | StartTimer () |
Private 成员函数 继承自 carla::profiler::LifetimeProfiled | |
LifetimeProfiled ()=default | |
Private 成员函数 继承自 carla::NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable (NonCopyable &&)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable & | operator= (NonCopyable &&)=delete |
Private 属性 | |
std::shared_ptr< BufferPool > | _buffer_pool |
boost::asio::deadline_timer | _deadline |
bool | _is_writing = false |
Listener::callback_function_type | _on_closed |
Listener::callback_function_type_response | _on_response |
Listener & | _server |
const size_t | _session_id |
socket_type | _socket |
boost::asio::io_context::strand | _strand |
time_duration | _timeout |
友元 | |
class | Listener |
A TCP server session.
When a session opens, it reads from the socket a stream id object and passes itself to the callback functor. The session closes itself after timeout of inactivity is met.
using carla::multigpu::Primary::socket_type = boost::asio::ip::tcp::socket |
|
explicit |
在文件 primary.cpp 第 27 行定义.
carla::multigpu::Primary::~Primary | ( | ) |
在文件 primary.cpp 第 41 行定义.
引用了 _socket.
void carla::multigpu::Primary::Close | ( | ) |
Post a job to close the session.
在文件 primary.cpp 第 176 行定义.
引用了 _strand.
被这些函数引用 StartTimer().
|
private |
在文件 primary.cpp 第 203 行定义.
引用了 _deadline, _on_closed, _session_id, _socket , 以及 carla::log_debug().
|
inlinestatic |
被这些函数引用 Write(), carla::multigpu::Router::Write(), carla::multigpu::Router::WriteToNext() , 以及 carla::multigpu::Router::WriteToOne().
void carla::multigpu::Primary::Open | ( | Listener::callback_function_type | on_opened, |
Listener::callback_function_type | on_closed, | ||
Listener::callback_function_type_response | on_response ) |
Starts the session and calls on_opened after successfully reading the stream id, and on_closed once the session is closed.
在文件 primary.cpp 第 49 行定义.
引用了 _on_closed, _on_response, _socket, DEBUG_ASSERT , 以及 ReadData().
void carla::multigpu::Primary::ReadData | ( | ) |
read data
在文件 primary.cpp 第 122 行定义.
引用了 _strand, DEBUG_ASSERT_EQ, DEBUG_ASSERT_NE, DEBUG_ONLY , 以及 carla::log_error().
被这些函数引用 Open().
|
private |
在文件 primary.cpp 第 185 行定义.
引用了 _deadline, _session_id, Close(), carla::log_debug() , 以及 carla::log_error().
|
inline |
void carla::multigpu::Primary::Write | ( | std::shared_ptr< const carla::streaming::detail::tcp::Message > | message | ) |
Writes some data to the socket.
在文件 primary.cpp 第 68 行定义.
引用了 _strand, DEBUG_ASSERT, DEBUG_ONLY , 以及 carla::log_error().
被这些函数引用 Write().
void carla::multigpu::Primary::Write | ( | std::string | text | ) |
|
private |
|
private |
被这些函数引用 CloseNow() , 以及 StartTimer().
|
private |
被这些函数引用 CloseNow() , 以及 Open().
|
private |
|
private |
被这些函数引用 CloseNow() , 以及 StartTimer().
|
private |
被这些函数引用 CloseNow(), Open() , 以及 ~Primary().
|
private |
|
private |