twin: expose partner roster in /status (fixes #3)
Reflector::refreshStatus() now emits a m_status["twin"] object (host, port, connection/hello state, prefix, peer_id, priorities) mirroring the existing trunks[] pattern. To populate the partner's connected-stations list, TwinLink now carries MsgTrunkNodeList (type 121) over the [TWIN] socket — reusing the trunk wire message, no new protocol type. Local roster changes flow via Reflector::sendNodeListToAllPeers() -> TwinLink::onLocalNodeListUpdated(); incoming lists are sanitized and cached in m_partner_nodes, surfaced as twin.nodes. Without this, [TWIN]-paired reflectors could not observe each other's rosters from /status — the data was not on the wire at all (TwinLink only carried talker state).
This commit is contained in:
1 parent
4bbd53172a
commit
fa6f137e1c
4 files changed
+214
-2
No files matched your search
@@ -1678,6 +1678,15 @@ void Reflector::refreshStatus(void)
|
||||
}
|
||||
m_status["trunks"] = trunks;
|
||||
|
||||
if (m_twin_link != nullptr)
|
||||
{
|
||||
m_status["twin"] = m_twin_link->statusJson();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_status.removeMember("twin");
|
||||
}
|
||||
|
||||
Json::Value cluster_arr(Json::arrayValue);
|
||||
for (uint32_t tg : m_cluster_tgs)
|
||||
{
|
||||
@@ -3133,6 +3142,11 @@ void Reflector::sendNodeListToAllPeers(void)
|
||||
link->sendNodeList(nodes);
|
||||
}
|
||||
|
||||
if (m_twin_link != nullptr)
|
||||
{
|
||||
m_twin_link->onLocalNodeListUpdated(nodes);
|
||||
}
|
||||
|
||||
if (m_mqtt != nullptr)
|
||||
{
|
||||
m_mqtt->publishLocalNodes(nodes);
|
||||
|
||||
Reference in new issue
Block a user