VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
proxy_server.h 文件参考

VLink proxy server daemon – singleton per process. 更多...

#include <cstdint>
#include <memory>
#include <string>
#include <vector>
#include "../base/message_loop.h"
proxy_server.h 的引用(Include)关系图:

浏览该文件的源代码.

 VLink proxy server daemon backed by a MessageLoop. 更多...
 Construction-time configuration for ProxyServer. 更多...

命名空间

宏定义

#define VLINK_PROXY_SERVER_EXPORT   __attribute__((visibility("default")))

详细描述

VLink proxy server daemon – singleton per process.

ProxyServer is the server-side half of the VLink proxy subsystem. It inherits from MessageLoop and runs an event loop that:

  1. Hosts a DiscoveryViewer to enumerate all active publishers and subscribers on the DDS domain.
  2. Accepts Control messages from ProxyAPI clients via a security-authenticated DDS channel.
  3. Broadcasts a 1-second Time heartbeat carrying CPU/memory usage, version string, hostname, and wall-clock / boot-time.
  4. Publishes per-topic statistics (freq, rate, loss, latency) once per second via a security-authenticated InfoList channel.
  5. Relays raw message bytes from discovered publishers to connected ProxyAPI listeners when operating in observe, record, or play mode.
  6. Optionally manages an embedded Iceoryx RouDi daemon when Config::use_iox is true.
  7. Loads and manages RunablePluginInterface shared-library plugins from Config::runnable_list.
Singleton Constraint
Only one ProxyServer may be constructed per operating-system process. A second construction attempt logs a fatal message and returns without initialising any channels.
Communication Architecture
ProxyAPI (kController)
|--- ControlPub --> [DDS] --> ControlSub ---|
| v
| ProxyServer (this)
| |
|<-- TimeSub <--- [DDS] <--- TimePub -------|
|<-- InfoSub <--- [DDS] <--- InfoPub -------|
|<-- DataSub <--- [DDS/SHM] <- DataPub -----|
Runnable Plugin Lifecycle
Plugins listed in Config::runnable_list are loaded in the constructor. When the MessageLoop starts (on_begin) each plugin's on_init() and async_run() are called. When the loop stops (on_end) each plugin's on_deinit(), quit(), and wait_for_quit() are called in order.
Environment Variables
  • VLINK_INTRA_BIND – when set (any value), the server subscribes to intra:// topics in addition to DDS/SHM, enabling in-process observation.
Usage Example
cfg.dds_impl = "dds";
cfg.domain_id = 0;
cfg.reliable = false;
cfg.async = true;
cfg.use_iox = false;
vlink::ProxyServer server(cfg);
server.async_run(); // start event loop in a background thread
// ... application runs ...
server.quit(true);
server.wait_for_quit();
注解
  • The constructor must be called on the main thread before any ProxyAPI clients connect on the same domain.
  • ProxyServer must be destroyed before the process exits; the destructor stops all timers, waits for the DiscoveryViewer, and releases every DDS handle in a deterministic order to avoid dangling callbacks.

宏定义说明

◆ VLINK_PROXY_SERVER_EXPORT

#define VLINK_PROXY_SERVER_EXPORT   __attribute__((visibility("default")))