|
VLink
2.0.0
A high-performance communication middleware
|
Daemon-side half of the VLink proxy subsystem – one server per process. 更多...
#include <cstdint>#include <memory>#include <string>#include <vector>#include "../base/message_loop.h"类 | |
| class | vlink::ProxyServer |
In-process VLink proxy daemon backed by a MessageLoop. 更多... | |
| struct | vlink::ProxyServer::Config |
Construction-time configuration aggregate for ProxyServer. 更多... | |
命名空间 | |
| vlink | |
宏定义 | |
| #define | VLINK_PROXY_SERVER_EXPORT __attribute__((visibility("default"))) |
Daemon-side half of the VLink proxy subsystem – one server per process.
ProxyServer is the in-process daemon that mediates between the VLink core (publishers, subscribers, setters, getters on the local DDS domain) and one or more ProxyAPI clients. It derives from MessageLoop, so once async_run() is called all scheduled work, timers, and asynchronous relays run inside the inherited loop's worker thread.
Behaviourally the server is responsible for the following duties:
DiscoveryViewer that enumerates every active publisher and subscriber on the DDS domain.Control messages from ProxyAPI clients over a security-authenticated DDS channel and dispatches them to the discovery layer.Time heartbeat carrying CPU/memory usage, the VLink version string, hostname, machine ID, and wall-clock plus boot-time.freq, rate, loss, latency – once per second through a security-authenticated InfoList channel.ProxyAPI listeners. In direct mode the data pubs/subs are created by the API side and the server stays exclusively on the control/discovery path; setter endpoints are observed with getter semantics so field last-value delivery is preserved.Config::use_iox is true.RunablePluginInterface shared-library plugins listed in Config::runnable_list at construction and drives their lifecycle from the inherited MessageLoop callbacks.ProxyServer may exist per operating-system process. A second construction logs a fatal message and throws before any DDS channels are wired up; running multiple servers in the same process is not supported and not safe.vlink::Uuid::random_hex() and exposes it through get_token(). The token is a process-lifetime protocol nonce, not a long-term cryptographic key. Clients fetch it by invoking the handshake RPC over the security-authenticated DDS channel; subsequent Control messages without a matching token are dropped server-side. Restarting the server invalidates every previously-issued token. Clients re-handshake after a same-identity token mismatch heartbeat, an identity-mismatch heartbeat that also carries a different token, or a local reset, before they will accept further heartbeats or publish new controls.Config::runnable_list are loaded inside the constructor. When the inherited MessageLoop starts (on_begin), each plugin's on_init() and async_run() are invoked in list order. On loop stop (on_end) each plugin's on_deinit(), quit(), and wait_for_quit() are invoked in the same order.| Variable | Meaning |
|---|---|
VLINK_INTRA_BIND | When set to any value, also subscribe to intra:// topics. |
ProxyAPI client connects on the same domain.DiscoveryViewer, and releases each DDS handle in a deterministic order so no dangling callback can fire after teardown. | #define VLINK_PROXY_SERVER_EXPORT __attribute__((visibility("default"))) |