Skyost / Bonsoir

A Zeroconf library that allows you to discover network services and to broadcast your own. Based on Apple Bonjour and Android NSD.
http://bonsoir.skyost.eu/
Other
107 stars 49 forks source link

Better error handling when discovery fails because type ends with .local #48

Closed ptrckdev closed 10 months ago

ptrckdev commented 1 year ago

I'm currently transitioning from "multicast_dns" where the type needed to end with "._tcp.local" for the service we are using.

The discovery with that type failed with error code 0, which wasn't really helpful to figure out the issue.

People might try this package because of referrals like in this comment, and if they have the same problem as me it could be helpful for them to know that they have to drop the ".local" suffix for discovery to succeed :)

Skyost commented 1 year ago

Hi,

Thanks for the feedback !

ptrckdev commented 1 year ago

I am not on my PC right now but in the debug logs I only saw the two output lines produced by this method when I tried to start discovery: https://github.com/Skyost/Bonsoir/blob/d1f4c8eae40bac8fc7dff663c27a6b01d3049a29/bonsoir_android/android/src/main/kotlin/fr/skyost/bonsoir/discovery/BonsoirDiscoveryListener.kt#L81

It had the error code „0“ and yes, I first awaited .ready

Skyost commented 10 months ago

Fixed in b8b3fa051f05e816e793c722e0a281d243d3f3b7.