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

"Error: getaddrinfo ENOENT" when haven't any connection network? #36

Open
25512345 opened this issue Nov 3, 2015 · 1 comment
Open

Comments

@25512345
Copy link

25512345 commented Nov 3, 2015

I use this code to get list android device connected in windows. But when I turn off all my network card or my network down it will catch exeption "getaddrinfo ENOENT". It will work when I have any network card connected even this is network card to virtual machine. How can I get listdevice when my network down?

const adb = require('adbkit');
const client = adb.createClient();

client.listDevices()
  .then(function(devices) {
    console.log(devices);
    //Set link button if detect device
  })
  .catch(function(err) {
    console.error('Something went wrong: ' + err);
  });
@25512345
Copy link
Author

Maybe if no connection connected, adbkit cannot lookup ip localhost. With options when create client has solve this problem 😄

const client = adb.createClient({host: "127.0.0.1", port: "5037"});

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

1 participant