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

feat: track service ttl and lastSeen #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Julusian
Copy link

This is a potential solution for #25

Currently the browser does not respect the TTL of the services it discovers.
Additionally, the only way to forget a service is for the remote to report that it is stopping, or to manually dispose and restart the browser.
This can easily lead to leaking memory, as some services do not report stopping, and there are many scenarios where they cannot (such as unclean shutdown or loss of network/power).

This attempts to resolve this is a non-breaking fashion.
To achieve this, we now track the ttl of the PTR record, and the last time we received the PTR record.
The user can then call an expire method, to trigger a check and purge of any services which have passed their ttl.

This makes an assumption that the ttl of each record is the same. If this is not the case, this could behave 'wrong' but I suspect that the current discovery could also get confused by that.

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

Successfully merging this pull request may close these issues.

1 participant