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

Handle serviceDown events. #55

Merged
merged 2 commits into from Aug 27, 2018
Merged

Conversation

mrstegeman
Copy link
Contributor

When an mDNS service goes down, remove the linked device. If a
service does not send out a notification that it's going down, it
will automatically expire at the TTL in the service record, which
tends to be quite short.

Fixes #54

When an mDNS service goes down, remove the linked device. If a
service does not send out a notification that it's going down, it
will automatically expire at the TTL in the service record, which
tends to be quite short.

Fixes WebThingsIO#54
@ghost ghost assigned mrstegeman Aug 27, 2018
@ghost ghost added the review label Aug 27, 2018
Copy link
Contributor

@hobinjk hobinjk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment inline


if (this.ws.readyState === WebSocket.OPEN) {
this.ws.close();
}

this.ws = null;
// Allow the cleanup code in createWebsocket to handle shutdown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanupAndReopen code should be updated to null this.ws then for paranoia's sake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mrstegeman mrstegeman merged commit da74064 into WebThingsIO:master Aug 27, 2018
@ghost ghost removed the review label Aug 27, 2018
@mrstegeman mrstegeman deleted the service-down branch August 27, 2018 18:45
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.

None yet

2 participants