-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: a simple way to automatically uniquify the service name when other hosts already have the desired name. #264
Comments
Ok, I think I understand what is going on here. The resolver is finding other machines in the network with the same name but different IP address. It's not clearly what, if anything, one should do about this. |
I suppose the point here really is to have a way to automate the RFC 6763 Appendix D policy of updating the name to something unique. This would be a useful feature. |
It's surely a useful feature! (It even feels overdue now you mentioned it)
yeah, this could be defined as a new event that can received by a daemon handle. I will take a look at the scope. (It seems like a substantial feature as we need to support Probing and Conflict Resolution. It'll a lot of fun implementing it ;-) ) |
Yeah, I was thinking about this and it's not entirely trivial to work around potential races. It's not hard to envisage two servers fighting in tandem to get a unique name! (though I might be missing something about how it works). Edit: this is clearly addressed in rfc 6762 as you linked to! |
Yes please! Something I'd like to request is either a user supplied function/closure for the conflict resolution algorithm, or at least some kind of hook or callback with the newly resolved name. If I remember correctly, this was either hard or impossible with Avahi. Bonjour did have some of interface for this (again, if my memory serves). The new conflict-resolved name should be saved in some kind of non-vol storage to be used on the next system start. Having some kind of callback would allow custom implementations, like for embedded systems. |
As the first / current phase, I'm looking into generating an event with the newly resolved name (as the RFC seems to mandate automatically generated name). Will keep the option of user supplied conflict resolution open / possible. |
@hgomersall I've opened a PR #265 that implements the basic conflict resolution (and required probing). When you have time, could you please take a look and give it a try? I also updated the example
|
Yeah, I'll take a look. It might not be for a few days if that's ok. |
Not sure where I saw it in the RFC's, or maybe it was in some Apple docs? |
Thanks! This makes sense. I've updated my PR to reflect this. |
PR merged. Please let me know if any problems. We can iterate / fix things before the next release. |
A new release 0.12.0 is published and includes this feature. Any comments / feedbacks are very appreciated, and will be helpful for adding the support of custom function of name conflict resolution. |
This might be desired behaviour following from my understanding of the correct way mDNS-SD should function. I might also be misusing the library.
I have a service running and advertising on a Linux machine. If I run the same executable on a different (Windows) machine, when I run my discover code I see the first machine advertised from the Windows machine as well as from the original Linux machine. I know this is the case as the TXT record contains a UUID generated from each server. I then receive two records advertising the Linux machine, each with a different UUID.
This is not a huge problem, as I can filter on repeated IP addresses, but it seems a little odd to re-advertise a service not explicitly registered.
The text was updated successfully, but these errors were encountered: