bonjour icon indicating copy to clipboard operation
bonjour copied to clipboard

Goodbye message wasn't sent

Open SerebryanskiySergei opened this issue 5 years ago • 2 comments

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?

SerebryanskiySergei avatar Apr 23 '19 12:04 SerebryanskiySergei

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

MeirionHughes avatar Aug 12 '19 13:08 MeirionHughes

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.

MichaelGoberling avatar Sep 02 '20 21:09 MichaelGoberling