bencevans / soyes

(WIP) A web-based controller for Sonos devices.
6 stars 1 forks source link

Error: setBroadcast EBADF on start #7

Closed daubman closed 11 years ago

daubman commented 11 years ago
uname -a
Linux beast.local 2.6.32-220.4.2.el6.x86_64 #1 SMP Tue Feb 14 04:00:16 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/redhat-release 
CentOS Linux release 6.0 (Final)
node --version
v0.10.5
node server.js 

dgram.js:331
    throw errnoException(process._errno, 'setBroadcast');
          ^
Error: setBroadcast EBADF
    at errnoException (dgram.js:440:11)
    at Socket.setBroadcast (dgram.js:331:11)
    at new Search (/home/adaubman/soyes/node_modules/sonos/lib/sonos.js:577:15)
    at Object.search (/home/adaubman/soyes/node_modules/sonos/lib/sonos.js:593:16)
    at Object.<anonymous> (/home/adaubman/soyes/server.js:25:7)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
  this.socket = dgram.createSocket('udp4', function(buffer, rinfo) {
    if(buffer.toString().match(/.+Sonos.+/)) {
      _this.emit('DeviceAvailable', new Sonos(rinfo.address));
    }
  });

  this.socket.bind();
  this.socket.setBroadcast(true);
bencevans commented 11 years ago

Thanks for the report @daubman. I believe it's due to the change in API for node 0.10.x as I've jotted in an issue on the node-sonos library project at https://github.com/bencevans/node-sonos/issues/11

I'll close this issue as it's a bug in the library rather than this implementation in particular.