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

Getting EBADF #2

Open
dickhardt opened this issue Mar 15, 2012 · 4 comments
Open

Getting EBADF #2

dickhardt opened this issue Mar 15, 2012 · 4 comments

Comments

@dickhardt
Copy link

34: this.server.addMembership(BROADCAST_ADDR); is throwing an EBADF exception

@SamDecrock
Copy link

I'm getting:

Error: addMembership EBADF
    at new errnoException (dgram.js:352:11)
    at Socket.addMembership (dgram.js:278:11)
    at new ControlPoint (/Users/sam/projects/dlnaremote/node-upnp-client/lib/upnp.js:34:15)
    at Object.<anonymous> (/Users/sam/projects/dlnaremote/node-upnp-client/test.js:4:20)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
    at EventEmitter._tickCallback (node.js:192:40)

@SamDecrock
Copy link

Ok, found it

You have to put this

this.server.addMembership(BROADCAST_ADDR);

behind this

this.server.bind(SSDP_PORT);

as stated here: nodejs/node-v0.x-archive#3254 (comment)

SamDecrock added a commit to SamDecrock/node-upnp-client that referenced this issue May 31, 2012
@neeagl
Copy link

neeagl commented Jan 21, 2014

It didn't work for me.

function ControlPoint() { 
  events.EventEmitter.call(this);
  this.server = dgram.createSocket('udp4');
  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);
}

@vijaybritto
Copy link

look here for solution

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

4 participants