Compare commits
2 Commits
72041aa3f9
...
7cd3444a4f
Author | SHA1 | Date |
---|---|---|
Timofey Gelazoniya | 7cd3444a4f | |
Roman Alexander | af78a184db |
|
@ -132,7 +132,7 @@ function ping(host, port = 19132, cb, timeout = 5000) {
|
||||||
// Close the socket and clear the timeout task
|
// Close the socket and clear the timeout task
|
||||||
// This is a general cleanup for success conditions
|
// This is a general cleanup for success conditions
|
||||||
closeSocket();
|
closeSocket();
|
||||||
cb(null, clientData);
|
cb(clientData, null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,9 +160,9 @@ export function pingBedrock(host, options = {}) {
|
||||||
|
|
||||||
const { port = 19132, timeout = 5000 } = options;
|
const { port = 19132, timeout = 5000 } = options;
|
||||||
|
|
||||||
return new Promise((resilve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
ping(host, port, (err, res) => {
|
ping(host, port, (res, err) => {
|
||||||
err ? reject(err) : resilve(res);
|
err ? reject(err) : resolve(res);
|
||||||
}, timeout);
|
}, timeout);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue