-
Notifications
You must be signed in to change notification settings - Fork 44
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
.browse
for all subservice's
#145
Comments
Thanks for opening the issue! It seems a valid use case. I've opened a PR to address this based on my understanding. If you got chance, let me know if the patch would work for you. |
Thanks for the quick response. I have given the changes a try and they are working for the original issue, thanks heaps! However, I have found another issue. The metadata for subservices is getting messed up. I am advertising the services:
and the metadata value for I feel like maybe this issue is related to |
do you advertise two different instance names for these two subtypes? or do you have one instance name that provides both subtype services? Regarding the spec, the RFC6763 section 7.1 states the following:
i.e. the service instance full name does not include |
Yeah, I do have the same instance type for all subservices so that would explain the behaviour. Working through potential solutions for my usecase, I don't think their is one right now.
I wonder if you would be open for Thanks heaps for your help! |
Let me think a bit about And, it seems to me that there are 2 things in play:
This could be supported by change
To allow this, what if including the sub service type name in the meta-data key itself? For example, instead of |
Just a thought, how many bytes is the cert. hash? Is it possible to move the cert. hash into the metadata (TXT record)? The UUID of subservice gives uniqueness of each instance name, so you don't need to utilize "subtype / subdomain" any more. And there are different instances so that no more metadata overwrites. |
For 1) I am not exactly sure what you're saying. Could you please clarify? For 2) I did think about that but then figured it probably wouldn't work because I figured it would still result in only one of the metadata making it through properly to the other end. Without knowing the internals I, however, don't know if this is true or not. I suspect using the UUID as the instance name by itself would not work because it's shared across nodes so multiple machines would end up advertising the same instance name. The certificate hash is unique for each node but the UUID is for a library which is a collection of resources that are synced between many nodes. Something I just thought of is maybe I could have a global Thanks for taking the time to help! |
Currently one service instance can only have one subtype (if any), which is stored in the In your use case, if you wanted to use one service instance for all sub service types, we would need to support multiple sub domains in one That said, from your descriptions, it seems like conceptually you have multiple different service instances (for one thing, the instances' metadata are different). So it might be cleaner to have one instance mapping to one sub service type. I don't really understand the use of For the PR, I think it's a good change anyway. I will merge it for now. If there are additional things we need to do for this issue, we can always open new PRs. |
Just wanted to follow up, sorry being a bit late, I feel that adding such API is too much hack for solving the original issue. (In mdns spec RFC 6763, there is meta-query to get a list of all services, but that's different, i.e. it only lists the service types, not instances of all services. And this lib already supports that). I don't know whether you solved the issue by now, but if there is anything else you think this library can add / change to help, please comment. Thanks. |
I am looking into using sub-services with mdns-sd and am wondering if there is a way to subscribe to events for all subservices of a specific service.
For example, I want to call
mdns_daemon.browse('my-service._udp.local.')
and receive events fora._sub._my-service._udp.local.
,b._sub._my-service._udp.local.
and etc. When subscribing to the "parent" service currently events are received, however, thesub_domain
property on theService
will beNone
which means I don't know which subservice (a
orb
) the event came from which is super important for my usecase.It seems like internally
a._sub._my-service._udp.local.
becomes an advertisement fora._sub._my-service._udp.local.
and one for_my-service._udp.local.
which explains this behavior but it still seems a little bit weird.As a workaround, I am going to call
.browse(...)
for each subservice and join them together withStreamUnordered
, however, this makes managing the whole thing a lot more complicated and error prone. Preferably I would like to have only a singleflume::Reciever
for all events which would simplify my code a heap.Thanks for this library, it's been working super well!
The text was updated successfully, but these errors were encountered: