-
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
ServiceRemoved triggered too long #301
Comments
Yes, this is the right API to call. And you need to actively call it at the interval that fits your need.
You should pass a duration of 2 seconds as the timeout. (The default is 10 seconds)
Not much burden unless you call it super frequently (every 2 seconds is okay). Internally it simply sends out a query (with one retry) for the service records, with a given timeout. When the timeout expires and no responses received from the service, the service is considered offline and Please let me know your experience of using this recently added API. I'm interested in learning if it works for users, and if not, how can be improved (including doc). Thanks! |
@keepsimple1 I'm not familiar with the mdns protocol, so I'm not quite sure what api's make sense. But, for now, the scenarios that use mdns are basically for device or service discovery on the LAN, and to support notification of services coming on and going offline. It would actually be better if a higher level and simpler encapsulation could be provided in addition, but of course, the encapsulation is pretty simple nowadays. But providing a simple api to just do service discovery I don't see a problem with, for example, just passing the name and attributes of the service to register the service. And the other end only needs to look up the specific service name. By the way, there is one other issue, there is a maximum length limit for the service's attributes, but your documentation doesn't describe it. I checked the source code, you use |
I think for this issue specifically, if you could let me know if the |
I misunderstood you. The api Sorry for not being able to help you. |
Right now it takes about two minutes for an offline notification to be triggered after a particular service goes offline, how can I reduce this delay?
https://docs.rs/mdns-sd/latest/mdns_sd/struct.ServiceDaemon.html#method.verify
Do I need to actively call this function at regular intervals to verify this?
I may need to get an offline notification immediately after the service goes offline in about two seconds.
Does calling this function frequently put a burden on the network? How does it work internally?
The text was updated successfully, but these errors were encountered: