Giter VIP home page Giter VIP logo

Comments (6)

koral-- avatar koral-- commented on July 27, 2024

Could you translate that Korean error message to English?

from adbkit.

slugger941 avatar slugger941 commented on July 27, 2024

Something went wrong: Error: failed to connect to '192.168.0.1:5555': Connection refused

from adbkit.

slugger941 avatar slugger941 commented on July 27, 2024

is this issue resolved??

from adbkit.

koral-- avatar koral-- commented on July 27, 2024

Not yet. Status is not changed.

from adbkit.

drauggres avatar drauggres commented on July 27, 2024

I can't reproduce it with @devicefarmer/adbkit@2

let adb = require("@devicefarmer/adbkit");
let client = adb.createClient();

client.connect("127.0.0.1", "5555").then(function(id) {
  console.log("connect id:%s", id);
}).catch(function(err) {
  console.error("Something went wrong:", err.stack);
});

setInterval(() => {
  console.log('ping')
}, 1000);

Output:

Something went wrong: Error: failed to connect to '127.0.0.1:5555': Connection refused
    at /tmp/test/node_modules/@devicefarmer/adbkit/lib/adb/command/host/connect.js:30:23
    at tryCatcher (/tmp/test/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/tmp/test/node_modules/bluebird/js/main/promise.js:503:31)
    at Promise._settlePromiseAt (/tmp/test/node_modules/bluebird/js/main/promise.js:577:18)
    at Async._drainQueue (/tmp/test/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/tmp/test/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/tmp/test/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate (node:internal/timers:466:21)
ping
ping
ping

The main process continues to run. Tested on node 10, 12, 14, 16, 17

from adbkit.

trueicecold avatar trueicecold commented on July 27, 2024

A bit late to the party but just wrap it with try/catch:

    try {
        await adbClient.connect('1.2.3.4', 5555);
        return {
            status: 1
        }
    }
    catch (e) {
        return {
            status: 0,
            error: e.message
        };
    }

from adbkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.