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

Why no notify event for the client? #78

Open
cinhcet opened this issue Apr 17, 2017 · 4 comments
Open

Why no notify event for the client? #78

cinhcet opened this issue Apr 17, 2017 · 4 comments

Comments

@cinhcet
Copy link

cinhcet commented Apr 17, 2017

Hi,

in my understanding (maybe I'm wrong) of the UPnP specifications, a client, which is the control point, should be able to listen to ssdp:alive, ssdp:byebye and ssdp:update notifications from devices. In the /example/client.js there is such a "notify" event, which is, however, never be emitted?
Looking at the code, in the method SSDP.prototype._notify such events are handled.
So why does the following not work?

var SSDP = require('node-ssdp').Client;
var client = new SSDP();

client.on('advertise-alive', function (headers, rinfo) {
  console.log(headers);
  console.log(rinfo);
});

client.on('advertise-bye', function (headers, rinfo) {
  console.log(headers);
  console.log(rinfo);
});

Thanks!

@brannondorsey
Copy link

brannondorsey commented Apr 11, 2018

+1, this doesn't appear to be working correctly. I also can't get the 'notify' event to fire (I'm monitoring with Wireshark and can confirm /NOTIFY multicast messages are being broadcast). The only event I've been able to get to fire is response.

Is it possible to view notifications and alive advertisements without explicitly calling client.search(...)? So far, the only SSDP messages I've been able to receive from the client are ones that I've explicitly triggered with an M-SEARCH request. I am interested in passively listening to service advertisements.

@mroch
Copy link

mroch commented Mar 30, 2019

see my comment here: #95 (comment)

the client doesn't wait for responses before exiting. you can do something like var timeout = setTimeout(function() {}, 1000000) and clearTimeout(timeout) when you're ready to exit. or remove the socket.unref() in SSDP.prototype._createSockets, but I don't know what other ramifications that has.

@simonbowen
Copy link

Did you ever get this working?

I am also trying to get the notify (or advertise-bye, advertise-live) event firing on the client. I've added a timeout at the end of script to keep it alive for testing purposes but cannot get the events fired at all. M-SEARCH works fine.

@troppoli
Copy link

I gave up and moved to dnssd2 it works.

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

5 participants