VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
vlink::ProxyServer Class Reference

VLink proxy server daemon backed by a MessageLoop. More...

#include <proxy_server.h>

Inheritance diagram for vlink::ProxyServer:
Collaboration diagram for vlink::ProxyServer:

Classes

struct  Config
 Construction-time configuration for ProxyServer. More...

Public Member Functions

 ProxyServer (const Config &config)
 Constructs a ProxyServer and initialises all subsystems.
 ~ProxyServer () override
 Destructor.

Protected Member Functions

size_t get_max_task_count () const override
 Returns the maximum queue depth.
uint32_t get_max_elapsed_time () const override
 Returns the maximum allowed task execution time in milliseconds.
void on_begin () override
 Called from the loop thread just before the first task is processed.
void on_end () override
 Called from the loop thread just after the last task has been processed.

Additional Inherited Members

 Queue implementation type. More...
 Idle strategy controlling CPU and latency trade-offs. More...
 Pre-defined task priority levels for kPriorityType loops. More...

Detailed Description

VLink proxy server daemon backed by a MessageLoop.

Manages all DDS/SHM channels, a DiscoveryViewer, heartbeat timers, and optional runnable plugins. Only one instance may exist per process. Use async_run() (inherited from MessageLoop) to start the event loop.

Constructor & Destructor Documentation

◆ ProxyServer()

vlink::ProxyServer::ProxyServer ( const Config & config)
explicit

Constructs a ProxyServer and initialises all subsystems.

Performs the following steps in order:

  1. Checks the process-global singleton guard; logs a fatal message and returns early if another instance already exists.
  2. Reads the VLINK_INTRA_BIND environment variable.
  3. If config.use_iox is true, calls init_shm_roudi() to start an embedded Iceoryx RouDi process.
  4. Calls init_server() to create all DDS/SHM channels, subscribe to Control messages, and start the 1-second time_timer and info_timer on the DiscoveryViewer's loop.
  5. Calls init_runnable() to load all plugins listed in config.runnable_list.
Parameters
configServer configuration. See Config for field details.
Note
The constructor does not start the MessageLoop; call async_run() (or run()) separately.
Here is the caller graph for this function:

◆ ~ProxyServer()

vlink::ProxyServer::~ProxyServer ( )
override

Destructor.

Stops and waits for the MessageLoop, all runnable plugins, the DiscoveryViewer, and all DDS handles in a deterministic teardown sequence. Also marks the singleton guard so future constructions in the same process behave correctly.

Member Function Documentation

◆ get_max_elapsed_time()

uint32_t vlink::ProxyServer::get_max_elapsed_time ( ) const
overrideprotectedvirtual

Returns the maximum allowed task execution time in milliseconds.

When a task exceeds this duration, on_task_timeout() is called. Returns 0 to disable timeout checking.

Returns
Maximum execution time in ms.

Reimplemented from vlink::MessageLoop.

◆ get_max_task_count()

size_t vlink::ProxyServer::get_max_task_count ( ) const
overrideprotectedvirtual

Returns the maximum queue depth.

Returns
kMaxTaskSize (10000) by default.

Reimplemented from vlink::MessageLoop.

◆ on_begin()

void vlink::ProxyServer::on_begin ( )
overrideprotectedvirtual

Called from the loop thread just before the first task is processed.

Override in subclasses to perform per-thread initialisation.

Reimplemented from vlink::MessageLoop.

◆ on_end()

void vlink::ProxyServer::on_end ( )
overrideprotectedvirtual

Called from the loop thread just after the last task has been processed.

Override in subclasses to perform per-thread cleanup.

Reimplemented from vlink::MessageLoop.

Here is the call graph for this function:

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