Phase 17: Enhanced mDNS discovery with peer caching and statistics#53
Merged
infinityabundance merged 4 commits intomainfrom Feb 13, 2026
Merged
Phase 17: Enhanced mDNS discovery with peer caching and statistics#53infinityabundance merged 4 commits intomainfrom
infinityabundance merged 4 commits intomainfrom
Conversation
…istics Co-authored-by: infinityabundance <255699974+infinityabundance@users.noreply.github.com>
Co-authored-by: infinityabundance <255699974+infinityabundance@users.noreply.github.com>
…iming dependency in tests Co-authored-by: infinityabundance <255699974+infinityabundance@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement mDNS discovery for automatic peer detection
Phase 17: Enhanced mDNS discovery with peer caching and statistics
Feb 13, 2026
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends basic mDNS/Avahi discovery with peer caching (64 entries, TTL-based expiry), richer service metadata (capability, bandwidth, max_peers), and statistics tracking. Minimal changes to existing code - enhances rather than rewrites.
Details
What changed?
Peer Cache System (
include/rootstream.h,src/discovery.c):peer_cache_entry_tstructure with TTL, online/offline tracking, contact/failure countersdiscovery_cache_add_peer(),discovery_cache_get_peer(),discovery_cache_get_online(), etc.Enhanced mDNS Advertiser (
src/discovery.c):capability(host/client),max_peers,bandwidthBroadcast Protocol (
src/discovery_broadcast.c):Manual Discovery (
src/discovery_manual.c):Testing (
tests/unit/test_discovery_cache.c):Rationale
Zero-configuration networking requires peers to discover capabilities without manual configuration. Basic mDNS provides hostname/port; this adds:
Aligns with RootStream's simplicity goal through automatic configuration and minimal operator intervention.
Testing
make)Notes
Original prompt
PHASE 17: mDNS Discovery - Automatic Peer Detection on LAN
🎯 Objective
Implement comprehensive multicast DNS (mDNS/Bonjour) discovery system that:
This is critical for seamless LAN setup - users should discover peers immediately without entering codes or IP addresses.
📋 Architecture Overview
🔨 Implementation Plan
1. mDNS Service Registration
File:
src/discovery/mdns_advertiser.h/cppAvahi Integration:
libavahi-client-dev)2. mDNS Service Browser
File:
src/discovery/mdns_browser.h/cpp