VLink  2.0.0
A high-performance communication middleware
discovery_reporter.h 文件参考

Process-wide discovery broadcaster that advertises live VLink endpoints. 更多...

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

浏览源代码.

class  vlink::DiscoveryReporter
 Periodic multicast broadcaster of the process's active VLink endpoints. 更多...
 

命名空间

 

详细描述

Process-wide discovery broadcaster that advertises live VLink endpoints.

DiscoveryReporter is the announce side of the VLink discovery subsystem. It runs on a private MessageLoop and emits periodic UDP multicast (default 239.255.0.100) payloads that describe every NodeImpl currently registered in the process: their URLs, communication kind, host name, PID, application name and an optional CPU usage sample. Listeners on the network – typically DiscoveryViewer instances or the vlink-cli tool – consume those payloads to rebuild a live endpoint topology.

Discovery flow:

*   NodeImpl::init_ext()  ----> DiscoveryReporter::add()
*                              |
*                              v
*                        +-----------+   periodic timer    UDP multicast
*                        |  loop     | ------------------> 239.255.0.100
*                        +-----------+
*                              ^                                  |
*                              |                                  v
*   NodeImpl::deinit_ext() ----> remove()                    DiscoveryViewer
* 

The process reporter is owned by the VLink runtime and is not exposed as a public singleton. add() and remove() are invoked automatically by NodeImpl::init_ext() / NodeImpl::deinit_ext(); normal user code should rarely touch this class directly.

Example
// Disable discovery entirely:
// export VLINK_DISCOVER_DISABLE=1
// Advanced tooling may construct an explicit reporter instance.
reporter.async_run();
注解
Discovery rides on a dedicated UDP socket and is independent of any VLink transport backend (intra/shm/dds/zenoh/...). Set VLINK_DISCOVER_DISABLE=1 to disable the runtime-owned reporter for a given process.