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

Goodbye message wasn't sent #55

Open
SerebryanskiySergei opened this issue Apr 23, 2019 · 2 comments
Open

Goodbye message wasn't sent #55

SerebryanskiySergei opened this issue Apr 23, 2019 · 2 comments

Comments

@SerebryanskiySergei
Copy link

SerebryanskiySergei commented Apr 23, 2019

Hi All!
I'm trying to stop service using:
this.logger.info('Stopping P2P mDNS annoucement...'); this.service.stop(); this.bonjour.unpublishAll(); this.bonjour.destroy();

But unfortinately my browser still have a service in the service's list after that call, so looks like it doesn't receive a goodbye message.

Am I doing something wrong?

@MeirionHughes
Copy link

Same here. Neither service stop nor unpublishAll seems to trigger the "down" event on the Browser side.

@MichaelGoberling
Copy link

MichaelGoberling commented Sep 2, 2020

I think you need to call destroy() in the unpublishAll() callback.

bonjour.unpublishAll(() => {
    bonjour.destroy()
});

After some testing, I found that if you call destroy() before unpublishAll() actually finishes, a goodbye message won't be sent.

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

3 participants