Ignore the localhost MDNS service

This commit is contained in:
Grishka
2023-09-26 22:43:31 +03:00
parent 0deec1a64b
commit 8b05c3abc5
2 changed files with 16 additions and 8 deletions

View File

@@ -299,6 +299,14 @@ public class NearbyConnectionManager : NSObject, NetServiceDelegate, InboundNear
#if DEBUG
print("found service \(service)")
#endif
for interface in service.interfaces{
if case .loopback=interface.type{
#if DEBUG
print("ignoring localhost service")
#endif
return
}
}
guard let endpointID=endpointID(for: service) else {return}
#if DEBUG
print("service name is valid, endpoint ID \(endpointID)")