p2p: mDNS

This commit is contained in:
2025-11-08 16:49:36 +01:00
parent 403168a00a
commit 858d41265c
3 changed files with 19 additions and 35 deletions
+1 -2
View File
@@ -7,7 +7,6 @@ pub use mdns_sd::DaemonEvent;
use mdns_sd::{Receiver, ServiceDaemon, ServiceEvent, ServiceInfo};
pub const LANSPREAD_SERVICE_TYPE: &str = "_lanspread._udp.local.";
pub const LANSPREAD_INSTANCE_NAME: &str = "softlan";
pub struct MdnsAdvertiser {
daemon: ServiceDaemon,
@@ -74,7 +73,7 @@ pub fn discover_service(
if let Some(address) = info.get_addresses().iter().next() {
tracing::info!("Found server at {}:{}", address, info.get_port());
return Ok((*address, info.get_port()).into());
return Ok((address.to_ip_addr(), info.get_port()).into());
}
tracing::error!(?info, "No address found in mDNS response.");