msloth / lgtv.js

Control LG WebOS TV using node.js
MIT License
248 stars 118 forks source link

Bad socket type specified. Valid types are: udp4, udp6 #7

Closed berkaytheunicorn closed 8 years ago

berkaytheunicorn commented 8 years ago

if I run this I got this error

lgtv = require("lgtv");

var retry_timeout = 10; // seconds
lgtv.discover_ip(retry_timeout, function(err, ipaddr) {
  if (err) {
    console.log("Failed to find TV IP address on the LAN. Verify that TV is on, and that you are on the same LAN/Wifi.");
  } else {
    console.log("TV ip addr is: " + ipaddr);
  }
});

error

dgram.js:88
  throw new Error('Bad socket type specified. Valid types are: udp4, udp6');
        ^
Error: Bad socket type specified. Valid types are: udp4, udp6
    at newHandle (dgram.js:88:9)
    at new Socket (dgram.js:113:16)
    at Object.exports.createSocket (dgram.js:130:10)
    at Object.discover_ip (/Users/berkaey/Desktop/remote/node_modules/lgtv/index.js:208:22)
    at Object.<anonymous> (/Users/berkaey/Desktop/remote/test.js:4:6)
    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)
berkaytheunicorn commented 8 years ago

btw I can connect with ip just fine.

msloth commented 8 years ago

Perhaps a version of node.js-thing, it worked for me @ 4.0.0, but I now updated to use string parameter instead of object. Thanks for reporting!

berkaytheunicorn commented 8 years ago

please add release for changes so we can just use "npm update" and now it waits and waits if there is no tv available is it normal?