Bonjour with NWListener & NWBrowser p2p connections

140 Views Asked by At

I am using Bonjour to advertise and discover devices that are near to one another. I am successfully starting my NWListener

 let parameters = NWParameters(tls: nil, tcp: tcpOptions)
                        parameters.includePeerToPeer = true
                        
                        let listener = try NWListener(using: parameters)
default 12:42:30.601650-0400    MDNS Listener starting
default 12:42:30.603393-0400    MDNS Listener state changed ready
default 12:42:30.603482-0400    MDNS Listener ready on Optional(64754)

When both devices are on the same network, the client finds the service and connects without issues. When I put one device on my guest network or take both off of WiFi in hope they discover over Bluetooth they are no longer discoverable. I assumed using includesPeerToPeer=true that networks wouldn't matter.

Im unable to find good resources about this topic, does anyone have any insight?

For reference my NWBrowser prints out

default 12:44:19.245018-0400    MDNS Start Browsing for type _myservice._tcp    PacketTunnel
default 12:44:19.254797-0400    MDNS Browser updated ready
default 12:44:19.254972-0400    MDNS Browser ready []
0

There are 0 best solutions below