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

'down' event not firing when other service shutdown #45

Open
826327700 opened this issue Dec 3, 2023 · 0 comments
Open

'down' event not firing when other service shutdown #45

826327700 opened this issue Dec 3, 2023 · 0 comments

Comments

@826327700
Copy link

import Bonjour from 'bonjour-service'

const instance = new Bonjour()

// advertise an HTTP server on port 3000
instance.publish({ name: 'My Web Server', type: 'http', port: 3000 })

// browse for all http services
let browser =instance.find({ type: 'http' })

browser.on('up', function (service) {
  console.log('server up:', service)
})

browser.on('down', function (service) { <---- It doesn't work when other service shutdown
  console.log('server down:', service)
})
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

1 participant