Skip to content
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

Browser does't respect TTL of services #25

Open
ambienthack opened this issue Jun 22, 2022 · 1 comment
Open

Browser does't respect TTL of services #25

ambienthack opened this issue Jun 22, 2022 · 1 comment

Comments

@ambienthack
Copy link

ambienthack commented Jun 22, 2022

This may be not a trivial feature to implement, because different DNS records making up a service have different TTL. TTL of .local record is typically 2 minutes, and for other records it is usually much longer.

There is also another related problem. If a device with a service was unplugged (not shut down gracefully), its services will live forever in browser.services .

In my app I tried to call browser.update() to make sure that services are still online, but the browser drops responses from already discovered services:

                matches.forEach((service: Service) => {
                    if (self.serviceMap[service.fqdn]) return // ignore already registered services
                    self.addService(service)
                })

So on the side of the app there is no way to distinguish between a service went offline because its device was unplugged (with no goodbye packet) and a service that is online and diligently sends discovery responses.

Workaround is to recreate the browser object each time I want to call browser.update().

@mdidon
Copy link
Member

mdidon commented Jul 14, 2022

@ambienthack Thanks for info. We are aware of this issue as it affect our own use of the library in other projects.
We'll keep you posted as updates are made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants