diff --git a/lib/upnp.js b/lib/upnp.js index 2900494..5f6add8 100644 --- a/lib/upnp.js +++ b/lib/upnp.js @@ -31,11 +31,11 @@ if (process.env.NODE_DEBUG && /upnp/.test(process.env.NODE_DEBUG)) { function ControlPoint() { events.EventEmitter.call(this); this.server = dgram.createSocket('udp4'); - this.server.addMembership(BROADCAST_ADDR); var self = this; this.server.on('message', function(msg, rinfo) {self.onRequestMessage(msg, rinfo);}); this._initParsers(); this.server.bind(SSDP_PORT); + this.server.addMembership(BROADCAST_ADDR); //fixed issue #2 } util.inherits(ControlPoint, events.EventEmitter); exports.ControlPoint = ControlPoint;