p2p: mDNS
This commit is contained in:
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user